签约申请添加cityCode字段,根据地市判断签约状态。

This commit is contained in:
mengkuiliang 2023-11-13 17:22:04 +08:00
parent b8449df3bb
commit 27b47ab841
9 changed files with 52 additions and 22 deletions

View File

@ -47,7 +47,7 @@ public class ResidentSignApplyController extends BaseController {
@ApiOperation("提交签约申请") @ApiOperation("提交签约申请")
@PostMapping("/save") @PostMapping("/save")
public R<String> save(@RequestBody ResidentSignApplyBody body) { public R<String> save(@RequestBody ResidentSignApplyBody body, @RequestHeader("region") String region) {
if (StringUtils.isBlank(body.getIdentity())) { if (StringUtils.isBlank(body.getIdentity())) {
return R.fail("身份证号不能为空"); return R.fail("身份证号不能为空");
} }
@ -57,7 +57,7 @@ public class ResidentSignApplyController extends BaseController {
if (body.getPackageList() == null || body.getPackageList().size() == 0) { if (body.getPackageList() == null || body.getPackageList().size() == 0) {
return R.fail("服务包不能为空"); return R.fail("服务包不能为空");
} }
residentSignAppletService.insert(body); residentSignAppletService.insert(body, region);
return R.ok(); return R.ok();
} }

View File

@ -36,7 +36,7 @@ public class HttpService {
* @Param [url, headerMap, resp] * @Param [url, headerMap, resp]
**/ **/
public Object get(String url, Map<String, Object> headerMap, Class<?> resp) { public Object get(String url, Map<String, Object> headerMap, Class<?> resp) {
log.info("get请求{}", url); // log.info("get请求{}", url);
HttpHeaders httpHeaders = new HttpHeaders(); HttpHeaders httpHeaders = new HttpHeaders();
if (headerMap != null) { if (headerMap != null) {
for (Map.Entry<String, Object> stringStringEntry : headerMap.entrySet()) { for (Map.Entry<String, Object> stringStringEntry : headerMap.entrySet()) {
@ -57,11 +57,11 @@ public class HttpService {
* @Param [url, headerMap, jsonObject] * @Param [url, headerMap, jsonObject]
**/ **/
public JSONObject post(String url, Map<String, Object> headerMap, JSONObject jsonObject) { public JSONObject post(String url, Map<String, Object> headerMap, JSONObject jsonObject) {
if (headerMap != null) { // if (headerMap != null) {
log.info("post请求{} 请求头:{} 参数:{}", url, new JSONObject(headerMap).toJSONString(), jsonObject.toJSONString()); // log.info("post请求{} 请求头:{} 参数:{}", url, new JSONObject(headerMap).toJSONString(), jsonObject.toJSONString());
} else { // } else {
log.info("post请求{} 参数:{}", url, jsonObject.toJSONString()); // log.info("post请求{} 参数:{}", url, jsonObject.toJSONString());
} // }
HttpHeaders httpHeaders = new HttpHeaders(); HttpHeaders httpHeaders = new HttpHeaders();
if (headerMap != null) { if (headerMap != null) {
for (Map.Entry<String, Object> stringStringEntry : headerMap.entrySet()) { for (Map.Entry<String, Object> stringStringEntry : headerMap.entrySet()) {
@ -81,11 +81,11 @@ public class HttpService {
* @Param [url, headerMap, jsonObject] * @Param [url, headerMap, jsonObject]
**/ **/
public JSONObject post(String url, Map<String, Object> headerMap, String paramStr) { public JSONObject post(String url, Map<String, Object> headerMap, String paramStr) {
if (headerMap != null) { // if (headerMap != null) {
log.info("post请求{} 请求头:{} 参数:{}", url, new JSONObject(headerMap).toJSONString(), paramStr); // log.info("post请求{} 请求头:{} 参数:{}", url, new JSONObject(headerMap).toJSONString(), paramStr);
} else { // } else {
log.info("post请求{} 参数:{}", url, paramStr); // log.info("post请求{} 参数:{}", url, paramStr);
} // }
HttpHeaders httpHeaders = new HttpHeaders(); HttpHeaders httpHeaders = new HttpHeaders();
if (headerMap != null) { if (headerMap != null) {
for (Map.Entry<String, Object> stringStringEntry : headerMap.entrySet()) { for (Map.Entry<String, Object> stringStringEntry : headerMap.entrySet()) {

View File

@ -5,6 +5,7 @@ import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
import com.xinelu.familydoctor.applet.pojo.entity.ResidentSignApplyEntity; import com.xinelu.familydoctor.applet.pojo.entity.ResidentSignApplyEntity;
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery; import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo; import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -41,7 +42,7 @@ public interface ResidentSignApplyMapper {
* @Param [identity] * @Param [identity]
* @return com.xinelu.mp.sign.pojo.vo.FdSignBookingVo * @return com.xinelu.mp.sign.pojo.vo.FdSignBookingVo
**/ **/
ResidentSignApplyVo getSignBookingByIdentity(String identity); ResidentSignApplyVo getSignBookingByIdentity(@Param("identity") String identity,@Param("region") String region);
/** /**
* @Author mengkuiliang * @Author mengkuiliang

View File

@ -245,4 +245,10 @@ public class ResidentSignApplyBody {
@ApiModelProperty(value = "户主身份证号", required = true) @ApiModelProperty(value = "户主身份证号", required = true)
private String householderIdentity; private String householderIdentity;
/**
* 签约地市1 德州 2东营 3济南
*/
@ApiModelProperty(value = "签约地市1 德州 2东营 3济南")
private String cityCode;
} }

View File

@ -286,5 +286,11 @@ public class ResidentSignApplyEntity implements Serializable {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
/**
* 签约地市1 德州 2东营 3济南
*/
@ApiModelProperty(value = "签约地市1 德州 2东营 3济南")
private String cityCode;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -272,4 +272,10 @@ public class ResidentSignApplyVo extends BaseEntity {
*/ */
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
/**
* 签约地市1 德州 2东营 3济南
*/
@ApiModelProperty(value = "签约地市1 德州 2东营 3济南")
private String cityCode;
} }

View File

@ -26,7 +26,7 @@ public interface IResidentSignAppletService {
* @return Integer * @return Integer
* @date 2022/11/21 9:38 * @date 2022/11/21 9:38
*/ */
void insert(ResidentSignApplyBody body); void insert(ResidentSignApplyBody body, String region);
/** /**
* 取消 * 取消
* @author lixinying * @author lixinying
@ -60,7 +60,7 @@ public interface IResidentSignAppletService {
* @Param * @Param
* @return * @return
**/ **/
ResidentSignApplyVo getSignBookingByIdentity(String identity); ResidentSignApplyVo getSignBookingByIdentity(String identity, String region);
/** /**
* @Author mengkuiliang * @Author mengkuiliang

View File

@ -59,7 +59,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
* @date 2022/11/21 9:38 * @date 2022/11/21 9:38
*/ */
@Override @Override
public void insert(ResidentSignApplyBody body) { public void insert(ResidentSignApplyBody body, String region) {
ApplyQuery applyQuery = new ApplyQuery(); ApplyQuery applyQuery = new ApplyQuery();
applyQuery.setIdentity(body.getIdentity()); applyQuery.setIdentity(body.getIdentity());
applyQuery.setBookingStatus("0"); applyQuery.setBookingStatus("0");
@ -95,6 +95,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
entity.setCrowdsName(body.getCrowdList().stream().map(CrowdDto::getCrowdName).collect(Collectors.joining(","))); entity.setCrowdsName(body.getCrowdList().stream().map(CrowdDto::getCrowdName).collect(Collectors.joining(",")));
entity.setPackagesNo(body.getPackageList().stream().map(PackageDto::getPackageNo).collect(Collectors.joining(","))); entity.setPackagesNo(body.getPackageList().stream().map(PackageDto::getPackageNo).collect(Collectors.joining(",")));
entity.setPackagesName(body.getPackageList().stream().map(PackageDto::getPackageName).collect(Collectors.joining(","))); entity.setPackagesName(body.getPackageList().stream().map(PackageDto::getPackageName).collect(Collectors.joining(",")));
entity.setCityCode(region);
residentSignApplyMapper.insert(entity); residentSignApplyMapper.insert(entity);
MessagePushBody messagePushBody = new MessagePushBody(); MessagePushBody messagePushBody = new MessagePushBody();
@ -164,8 +165,8 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
* @Param [identity] * @Param [identity]
**/ **/
@Override @Override
public ResidentSignApplyVo getSignBookingByIdentity(String identity) { public ResidentSignApplyVo getSignBookingByIdentity(String identity, String region) {
return residentSignApplyMapper.getSignBookingByIdentity(identity); return residentSignApplyMapper.getSignBookingByIdentity(identity, region);
} }
/** /**
@ -217,7 +218,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
public Map<String, Object> checkSignApply(String identity, String region) { public Map<String, Object> checkSignApply(String identity, String region) {
Map<String, Object> retMap = new HashMap<>(); Map<String, Object> retMap = new HashMap<>();
// 查询未完成的签约申请 // 查询未完成的签约申请
ResidentSignApplyVo signBookingInfoVo = getSignBookingByIdentity(identity); ResidentSignApplyVo signBookingInfoVo = getSignBookingByIdentity(identity, region);
if (signBookingInfoVo != null) { if (signBookingInfoVo != null) {
retMap.put("code", "01"); retMap.put("code", "01");
retMap.put("info", DateUtils.parseDateToStr("yyyy年MM月dd日", signBookingInfoVo.getSignTime()) + "已在【" + signBookingInfoVo.getOrgName() + "】【" + signBookingInfoVo.getTeamName() + "】【" + signBookingInfoVo.getUserName() + "】申请签约"); retMap.put("info", DateUtils.parseDateToStr("yyyy年MM月dd日", signBookingInfoVo.getSignTime()) + "已在【" + signBookingInfoVo.getOrgName() + "】【" + signBookingInfoVo.getTeamName() + "】【" + signBookingInfoVo.getUserName() + "】申请签约");

View File

@ -48,6 +48,7 @@
<result property="refuseReason" column="refuse_reason" jdbcType="VARCHAR"/> <result property="refuseReason" column="refuse_reason" jdbcType="VARCHAR"/>
<result property="approvalTime" column="approval_time" jdbcType="TIMESTAMP"/> <result property="approvalTime" column="approval_time" jdbcType="TIMESTAMP"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/> <result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -65,7 +66,7 @@
sign_time,sign_years,resident_autograph_path,relationship_with_householder, sign_time,sign_years,resident_autograph_path,relationship_with_householder,
householder_name,householder_identity,apply_time, householder_name,householder_identity,apply_time,
booking_status,cancel_time,approval_status, booking_status,cancel_time,approval_status,
refuse_reason,approval_time,remark refuse_reason,approval_time,remark,city_code
</sql> </sql>
<sql id="Base_Column_List_fd"> <sql id="Base_Column_List_fd">
@ -82,7 +83,7 @@
p.sign_time,p.sign_years,p.resident_autograph_path,p.relationship_with_householder, p.sign_time,p.sign_years,p.resident_autograph_path,p.relationship_with_householder,
p.householder_name,p.householder_identity,p.apply_time, p.householder_name,p.householder_identity,p.apply_time,
p.booking_status,p.cancel_time,p.approval_status, p.booking_status,p.cancel_time,p.approval_status,
p.refuse_reason,p.approval_time,p.remark p.refuse_reason,p.approval_time,p.remark,city_code
</sql> </sql>
<!-- 新增 --> <!-- 新增 -->
@ -177,6 +178,9 @@
</if> </if>
<if test="remark != null">remark, <if test="remark != null">remark,
</if> </if>
<if test="cityCode != null">
city_code,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bookingNo != null and bookingNo != ''">#{bookingNo}, <if test="bookingNo != null and bookingNo != ''">#{bookingNo},
@ -267,6 +271,9 @@
</if> </if>
<if test="remark != null">#{remark}, <if test="remark != null">#{remark},
</if> </if>
<if test="cityCode != null">
#{cityCode},
</if>
</trim> </trim>
</insert> </insert>
@ -332,6 +339,9 @@
<select id="getSignBookingByIdentity" resultType="com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo"> <select id="getSignBookingByIdentity" resultType="com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo">
select <include refid="Base_Column_List"></include> from resident_sign_apply where identity = #{identity} and select <include refid="Base_Column_List"></include> from resident_sign_apply where identity = #{identity} and
booking_status = '0' and approval_status = '0' booking_status = '0' and approval_status = '0'
<if test="region != null and region != ''">
and city_code = #{region}
</if>
order by apply_time desc limit 1 order by apply_time desc limit 1
</select> </select>