diff --git a/src/main/java/cn/timer/api/bean/insure/InsureUser.java b/src/main/java/cn/timer/api/bean/insure/InsureUser.java index 7316614..7073618 100644 --- a/src/main/java/cn/timer/api/bean/insure/InsureUser.java +++ b/src/main/java/cn/timer/api/bean/insure/InsureUser.java @@ -158,7 +158,7 @@ public class InsureUser extends Model<InsureUser> { @ApiModelProperty(value = "批改原因") private String reason; - @ApiModelProperty(value = "批改原因") + @ApiModelProperty(value = "录单时间") private Date createTime; diff --git a/src/main/java/cn/timer/api/controller/insure/CallBackContorll.java b/src/main/java/cn/timer/api/controller/insure/CallBackContorll.java index 6742ed1..840fb88 100644 --- a/src/main/java/cn/timer/api/controller/insure/CallBackContorll.java +++ b/src/main/java/cn/timer/api/controller/insure/CallBackContorll.java @@ -235,13 +235,15 @@ public class CallBackContorll { insurePolicy.setStatus("2"); insurePolicy.setUpdateTime(new Date()); insurePolicy.updateById(); + InsureLog.builder().type(7).createTime(new Date()).requestType(1).requestPath(base_api_url + "/payCallBack") + .returnCode("suc").returnMsg(dataMap.get("errmsg").toString()).build().insert(); } else if (dataMap.get("errcode").toString().equals("suc")) { InsureLog.builder().type(7).createTime(new Date()).requestType(1).requestPath(base_api_url + "/payCallBack") .returnCode("suc").returnMsg("确认支付成功,支付方式:" + insurePay.getPayType() + ",支付金额:" + callBack.getAmount()).policyId(insurePay.getPolicyId()).build().insert(); } else { - InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(6) + InsureLog.builder().requestParam(JSONObject.toJSONString(setParams(JSONObject.toJSONString(bodyMap), appid, secret))).type(7) .requestData(JSONObject.toJSONString(bodyMap)).createTime(new Date()).requestType(1).returnBody(data).requestPath(getPolicyUrl) - .returnCode(dataMap.get("errcode").toString()).returnMsg(dataMap.get("errmsg").toString()).build().insert(); + .returnCode(dataMap.get("errcode").toString()).policyId(insurePay.getPolicyId()).returnMsg(dataMap.get("errmsg").toString()).build().insert(); } } map.put("status", "1"); @@ -293,6 +295,8 @@ public class CallBackContorll { insurePolicy.updateById(); insurePay.updateById(); } + InsureLog.builder().type(7).createTime(new Date()).requestType(1).returnBody(sb.toString()).requestPath(getPolicyUrl) + .returnCode(callBack.getStatus()).policyId(insurePay.getPolicyId()).returnMsg(callBack.getErr_msg()).build().insert(); return map; } } diff --git a/src/main/java/cn/timer/api/controller/insure/InsureContorll.java b/src/main/java/cn/timer/api/controller/insure/InsureContorll.java index 6a3d51e..32ad76c 100644 --- a/src/main/java/cn/timer/api/controller/insure/InsureContorll.java +++ b/src/main/java/cn/timer/api/controller/insure/InsureContorll.java @@ -331,6 +331,7 @@ public class InsureContorll { insureUser.setPolicyDateEnd(dtf3.parse(insureDto.getPolicyDateEnd())); insureUser.setApplyType(2);//投保类型 insureUser.setPolicyId(insurePolicy.getId()); + insureUser.setCreateTime(new Date()); insureUser.insert(); if (dataMap.get("errcode").toString().equals("suc")) { y.setIsInsure(1); diff --git a/src/main/java/cn/timer/api/controller/insure/InsureUserController.java b/src/main/java/cn/timer/api/controller/insure/InsureUserController.java index faba07f..fbe2058 100644 --- a/src/main/java/cn/timer/api/controller/insure/InsureUserController.java +++ b/src/main/java/cn/timer/api/controller/insure/InsureUserController.java @@ -17,6 +17,9 @@ import cn.timer.api.utils.ExcelUtils; import cn.timer.api.utils.Page; import cn.timer.api.utils.Result; import cn.timer.api.utils.ResultUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.aliyun.oss.common.utils.StringUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.beust.jcommander.internal.Lists; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; @@ -64,6 +67,12 @@ public class InsureUserController{ @ApiOperation(value = "3.保单列表--8小时端", httpMethod = "POST", notes = "保单列表") public Result<Object> userPolicyList(@CurrentUser UserBean userBean, @RequestBody PolicyDto policyDto) { Map map = Maps.newHashMap(); + if(!StringUtils.isNullOrEmpty(policyDto.getCreateTime())){ + List arr= JSONObject.parseArray(policyDto.getCreateTime(), String.class); + policyDto.setPolicyDateStart(arr.get(0).toString()); + policyDto.setPolicyDateEnd(arr.get(1).toString()); + } + policyDto.setOrgCode(String.valueOf(userBean.getOrgCode())); List<PolicyDto> list = insureUserMapper.selectPolicyList(policyDto); map.put("list", Optional.ofNullable(list).orElse(Lists.newArrayList())); map.put("total", insureUserMapper.totalUser(policyDto)); diff --git a/src/main/java/cn/timer/api/dto/insure/PolicyDto.java b/src/main/java/cn/timer/api/dto/insure/PolicyDto.java index d675b50..546035e 100644 --- a/src/main/java/cn/timer/api/dto/insure/PolicyDto.java +++ b/src/main/java/cn/timer/api/dto/insure/PolicyDto.java @@ -44,5 +44,5 @@ public class PolicyDto { private Integer payId; private Integer policyId; private Integer applyType; - + private String monthD; } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 034e198..b6ee18a 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -287,7 +287,7 @@ insure: secret: 'acb329868c31d5b3ba03de40dac13dd9' uploadUrl: 'http://sandbox.portal.unistar-ins.com/service/Home/Index/fileUpload' insuredUrl: 'http://sandbox.portal.unistar-ins.com/mall/Home/Index/createQuotePolicy' - getPolicyUrl: 'http://sandbox.portal.unistar-ins.com/issuing//Home/Index/index' + getPolicyUrl: 'http://sandbox.portal.unistar-ins.com/issuing/Home/Index/index' #查询保单信息 policyDetail: 'http://sandbox.portal.unistar-ins.com/issuing/Home/Index/policy' createQuote: 'http://sandbox.portal.unistar-ins.com/mall/Home/Index/createQuote' diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 36521e5..be20ff7 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -254,11 +254,12 @@ wxgzh: encodingAesKey: 'chAbt69dLAtk8HH0oGMuZwHzK2SuhnxZI5Jbzc4nNzX' insure: - appid: '1002303100602312445' + #投保 + appid: '1002303100602312445' secret: 'acb329868c31d5b3ba03de40dac13dd9' - uploadUrl: 'http://sandbox.portal.unistar-ins.com/service/Home/Index/fileUpload' + uploadUrl: 'http://sandbox.portal.unistar-ins.com/service/Home/Index/fileUpload' insuredUrl: 'http://sandbox.portal.unistar-ins.com/mall/Home/Index/createQuotePolicy' - getPolicyUrl: 'http://sandbox.portal.unistar-ins.com/issuing//Home/Index/index' + getPolicyUrl: 'http://sandbox.portal.unistar-ins.com/issuing/Home/Index/index' #查询保单信息 policyDetail: 'http://sandbox.portal.unistar-ins.com/issuing/Home/Index/policy' createQuote: 'http://sandbox.portal.unistar-ins.com/mall/Home/Index/createQuote' @@ -267,7 +268,7 @@ insure: #保全 appidq: '1000115041006006938' - secretq: '6ba1bf4aa0bd14368c95ff0b9934a17b' + secretq: '6ba1bf4aa0bd14368c95ff0b9934a17b' uploadUrlq: 'http://sandbox.portal.unistar-ins.com/fuli/Home/Index/file_upload' batchUrl: 'http://sandbox.portal.unistar-ins.com/fuli/Home/WelfareProduct/batch_declare' cancelPayment: 'http://sandbox.portal.unistar-ins.com/fuli/Home/OrderImport/order_import_set' diff --git a/src/main/resources/mapping/insure/InsureUserMapper.xml b/src/main/resources/mapping/insure/InsureUserMapper.xml index c05379a..a984f5c 100644 --- a/src/main/resources/mapping/insure/InsureUserMapper.xml +++ b/src/main/resources/mapping/insure/InsureUserMapper.xml @@ -281,7 +281,7 @@ <select id="selectPolicyList" resultType="cn.timer.api.dto.insure.PolicyDto"> select iu.id,yme.`name`,yme.zj_type,yme.zj_num,iu.policy_no,iu.`status`,io.name as schemeName,iu.policy_date_start,iu.insure_status, - iu.policy_date_end,ip.create_time,iu.insured_name,iu.benefit_basic_plan AS benefitBasicPlan,iu.price AS price, + iu.policy_date_end,iu.create_time,iu.insured_name,iu.benefit_basic_plan AS benefitBasicPlan,iu.price AS price, iu.user_id as userId,iu.batch_no as batchNo,iu.benefit_occupation_category as benefitOccupationCategory, iu.policy_id as policyId, iu.apply_type as applyType @@ -311,23 +311,27 @@ <if test="policyDto.name !=null and policyDto.name !=''"> and iu.insured_e_contact like CONCAT('%',#{policyDto.name},'%') </if> - <if test="policyDto.policyDateStart !=null and policyDto.policyDateStart !=''"> - and iu.policy_date_start <![CDATA[>=]]> #{policyDto.policyDateStart} - </if> - <if test="policyDto.policyDateEnd !=null and policyDto.policyDateEnd !=''"> - and iu.policy_date_end <![CDATA[<=]]> #{policyDto.policyDateEnd} - </if> - <if test="policyDto.status !=null and policyDto.status !=''"> - and iu.insure_status = #{policyDto.status} - </if> +<!-- <if test="policyDto.policyDateStart !=null and policyDto.policyDateStart !=''">--> +<!-- and iu.policy_date_start <![CDATA[<=]]> #{policyDto.policyDateStart}--> +<!-- </if>--> +<!-- <if test="policyDto.policyDateEnd !=null and policyDto.policyDateEnd !=''">--> +<!-- and iu.policy_date_start <![CDATA[>=]]> #{policyDto.policyDateEnd}--> +<!-- </if>--> <if test="policyDto.status !=null and policyDto.status !=''"> and iu.insure_status = #{policyDto.status} </if> <if test="policyDto.applyType !=null and policyDto.applyType !=''"> and iu.apply_type = #{policyDto.applyType} </if> + <if test="policyDto.monthD !=null and policyDto.monthD !=''"> + AND DATE_FORMAT(iu.policy_date_start,'%Y-%m') = #{policyDto.monthD} + </if> + <if test="policyDto.policyDateStart !=null and policyDto.policyDateStart !='' and policyDto.policyDateEnd !=null and policyDto.policyDateEnd !=''"> + and iu.create_time BETWEEN #{policyDto.policyDateStart} and #{policyDto.policyDateEnd} + </if> + </where> - order by iu.policy_date_start desc + order by iu.create_time desc <if test="policyDto.page.offset != null and policyDto.page.totalPage !=null"> LIMIT #{policyDto.page.offset},#{policyDto.page.totalPage} </if>