签约申请添加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("提交签约申请")
@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())) {
return R.fail("身份证号不能为空");
}
@ -57,7 +57,7 @@ public class ResidentSignApplyController extends BaseController {
if (body.getPackageList() == null || body.getPackageList().size() == 0) {
return R.fail("服务包不能为空");
}
residentSignAppletService.insert(body);
residentSignAppletService.insert(body, region);
return R.ok();
}

View File

@ -36,7 +36,7 @@ public class HttpService {
* @Param [url, headerMap, resp]
**/
public Object get(String url, Map<String, Object> headerMap, Class<?> resp) {
log.info("get请求{}", url);
// log.info("get请求{}", url);
HttpHeaders httpHeaders = new HttpHeaders();
if (headerMap != null) {
for (Map.Entry<String, Object> stringStringEntry : headerMap.entrySet()) {
@ -57,11 +57,11 @@ public class HttpService {
* @Param [url, headerMap, jsonObject]
**/
public JSONObject post(String url, Map<String, Object> headerMap, JSONObject jsonObject) {
if (headerMap != null) {
log.info("post请求{} 请求头:{} 参数:{}", url, new JSONObject(headerMap).toJSONString(), jsonObject.toJSONString());
} else {
log.info("post请求{} 参数:{}", url, jsonObject.toJSONString());
}
// if (headerMap != null) {
// log.info("post请求{} 请求头:{} 参数:{}", url, new JSONObject(headerMap).toJSONString(), jsonObject.toJSONString());
// } else {
// log.info("post请求{} 参数:{}", url, jsonObject.toJSONString());
// }
HttpHeaders httpHeaders = new HttpHeaders();
if (headerMap != null) {
for (Map.Entry<String, Object> stringStringEntry : headerMap.entrySet()) {
@ -81,11 +81,11 @@ public class HttpService {
* @Param [url, headerMap, jsonObject]
**/
public JSONObject post(String url, Map<String, Object> headerMap, String paramStr) {
if (headerMap != null) {
log.info("post请求{} 请求头:{} 参数:{}", url, new JSONObject(headerMap).toJSONString(), paramStr);
} else {
log.info("post请求{} 参数:{}", url, paramStr);
}
// if (headerMap != null) {
// log.info("post请求{} 请求头:{} 参数:{}", url, new JSONObject(headerMap).toJSONString(), paramStr);
// } else {
// log.info("post请求{} 参数:{}", url, paramStr);
// }
HttpHeaders httpHeaders = new HttpHeaders();
if (headerMap != null) {
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.query.ApplyQuery;
import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -41,7 +42,7 @@ public interface ResidentSignApplyMapper {
* @Param [identity]
* @return com.xinelu.mp.sign.pojo.vo.FdSignBookingVo
**/
ResidentSignApplyVo getSignBookingByIdentity(String identity);
ResidentSignApplyVo getSignBookingByIdentity(@Param("identity") String identity,@Param("region") String region);
/**
* @Author mengkuiliang

View File

@ -245,4 +245,10 @@ public class ResidentSignApplyBody {
@ApiModelProperty(value = "户主身份证号", required = true)
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 = "备注")
private String remark;
/**
* 签约地市1 德州 2东营 3济南
*/
@ApiModelProperty(value = "签约地市1 德州 2东营 3济南")
private String cityCode;
private static final long serialVersionUID = 1L;
}

View File

@ -272,4 +272,10 @@ public class ResidentSignApplyVo extends BaseEntity {
*/
@ApiModelProperty(value = "备注")
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
* @date 2022/11/21 9:38
*/
void insert(ResidentSignApplyBody body);
void insert(ResidentSignApplyBody body, String region);
/**
* 取消
* @author lixinying
@ -60,7 +60,7 @@ public interface IResidentSignAppletService {
* @Param
* @return
**/
ResidentSignApplyVo getSignBookingByIdentity(String identity);
ResidentSignApplyVo getSignBookingByIdentity(String identity, String region);
/**
* @Author mengkuiliang

View File

@ -59,7 +59,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
* @date 2022/11/21 9:38
*/
@Override
public void insert(ResidentSignApplyBody body) {
public void insert(ResidentSignApplyBody body, String region) {
ApplyQuery applyQuery = new ApplyQuery();
applyQuery.setIdentity(body.getIdentity());
applyQuery.setBookingStatus("0");
@ -95,6 +95,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
entity.setCrowdsName(body.getCrowdList().stream().map(CrowdDto::getCrowdName).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.setCityCode(region);
residentSignApplyMapper.insert(entity);
MessagePushBody messagePushBody = new MessagePushBody();
@ -164,8 +165,8 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
* @Param [identity]
**/
@Override
public ResidentSignApplyVo getSignBookingByIdentity(String identity) {
return residentSignApplyMapper.getSignBookingByIdentity(identity);
public ResidentSignApplyVo getSignBookingByIdentity(String identity, String region) {
return residentSignApplyMapper.getSignBookingByIdentity(identity, region);
}
/**
@ -217,7 +218,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
public Map<String, Object> checkSignApply(String identity, String region) {
Map<String, Object> retMap = new HashMap<>();
// 查询未完成的签约申请
ResidentSignApplyVo signBookingInfoVo = getSignBookingByIdentity(identity);
ResidentSignApplyVo signBookingInfoVo = getSignBookingByIdentity(identity, region);
if (signBookingInfoVo != null) {
retMap.put("code", "01");
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="approvalTime" column="approval_time" jdbcType="TIMESTAMP"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
@ -65,7 +66,7 @@
sign_time,sign_years,resident_autograph_path,relationship_with_householder,
householder_name,householder_identity,apply_time,
booking_status,cancel_time,approval_status,
refuse_reason,approval_time,remark
refuse_reason,approval_time,remark,city_code
</sql>
<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.householder_name,p.householder_identity,p.apply_time,
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>
<!-- 新增 -->
@ -177,6 +178,9 @@
</if>
<if test="remark != null">remark,
</if>
<if test="cityCode != null">
city_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bookingNo != null and bookingNo != ''">#{bookingNo},
@ -267,6 +271,9 @@
</if>
<if test="remark != null">#{remark},
</if>
<if test="cityCode != null">
#{cityCode},
</if>
</trim>
</insert>
@ -332,6 +339,9 @@
<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
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
</select>