소스 검색

1)推广链接文字改为自定义,如果已注册则不显示链接,只提示。
2)完成下月投保单新增人员功能。
3)增加缴费通知->企业,投保成功通知->企业。
4)投保申请单和每月投保单增加编号以及出单时间。

tomatozq 5 년 전
부모
커밋
1afd1c8c0b
18개의 변경된 파일431개의 추가작업 그리고 718개의 파일을 삭제
  1. 59 0
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/admin/controller/JwtsUserController.java
  2. 18 3
      picc-admin-server/src/main/java/com/jpsoft/picc/modules/business/controller/InsurancePolicyController.java
  3. 20 0
      picc-common/src/main/java/com/jpsoft/picc/modules/base/dao/ReplyMessageDAO.java
  4. 35 0
      picc-common/src/main/java/com/jpsoft/picc/modules/base/entity/ReplyMessage.java
  5. 19 0
      picc-common/src/main/java/com/jpsoft/picc/modules/base/service/ReplyMessageService.java
  6. 75 0
      picc-common/src/main/java/com/jpsoft/picc/modules/base/service/impl/ReplyMessageServiceImpl.java
  7. 20 381
      picc-common/src/main/java/com/jpsoft/picc/modules/business/entity/InsuranceApplication.java
  8. 20 318
      picc-common/src/main/java/com/jpsoft/picc/modules/business/entity/InsurancePolicy.java
  9. 83 0
      picc-common/src/main/resources/mapper/base/ReplyMessage.xml
  10. 11 1
      picc-common/src/main/resources/mapper/business/InsuranceApplication.xml
  11. 11 1
      picc-common/src/main/resources/mapper/business/InsurancePolicy.xml
  12. 5 1
      picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/InsuranceApplicationController.java
  13. 5 1
      picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/InsurancePolicyController.java
  14. 43 5
      picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/pub/controller/PayController.java
  15. 2 1
      weixin-middleware/src/main/java/com/jpsoft/weixin/callback/EventCallback.java
  16. 3 4
      weixin-middleware/src/main/java/com/jpsoft/weixin/controller/WeixinController.java
  17. 1 1
      weixin-middleware/src/main/resources/application-dev.yml
  18. 1 1
      weixin-middleware/src/main/resources/application-production.yml

+ 59 - 0
picc-admin-server/src/main/java/com/jpsoft/picc/modules/admin/controller/JwtsUserController.java

@@ -1,11 +1,15 @@
 package com.jpsoft.picc.modules.admin.controller;
 
 import com.jpsoft.picc.modules.base.entity.CompanyUser;
+import com.jpsoft.picc.modules.base.entity.ReplyMessage;
+import com.jpsoft.picc.modules.base.service.CompanyUserService;
+import com.jpsoft.picc.modules.base.service.ReplyMessageService;
 import com.jpsoft.picc.modules.common.config.WeixinConfig;
 import com.jpsoft.picc.modules.common.constant.WeixinEvent;
 import com.jpsoft.picc.modules.common.dto.MessageResult;
 import com.jpsoft.picc.modules.common.dto.MsgResult;
 import com.jpsoft.picc.modules.common.utils.DES3;
+import com.jpsoft.picc.modules.common.utils.VelocityHelper;
 import com.jpsoft.picc.modules.common.utils.WeixinUtil;
 import com.jpsoft.picc.modules.sys.entity.User;
 import com.jpsoft.picc.modules.sys.service.UserService;
@@ -26,9 +30,12 @@ import springfox.documentation.annotations.ApiIgnore;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+import java.net.URLEncoder;
 import java.security.Key;
 import java.util.Base64;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 @Slf4j
@@ -50,6 +57,12 @@ public class JwtsUserController {
     @Autowired
     private RedisTemplate redisTemplate;
 
+    @Autowired
+    private ReplyMessageService replyMessageService;
+
+    @Autowired
+    private CompanyUserService companyUserService;
+
     @PostMapping("/login")
     @ApiOperation(value="登录获取token,在swagger ui中获取token时将写入session,调用其它接口时不用再设置header")
     @ApiImplicitParams({
@@ -250,6 +263,52 @@ public class JwtsUserController {
         return msgResult;
     }
 
+    /**
+     * 推广码扫码回调
+     * @param eventKey
+     * @param wechatId
+     * @param openId
+     * @return 返回值会在微信中显示
+     */
+    @ApiOperation(value = "推广码扫码回调")
+    @PostMapping(value="/pub/qrcode/promotion/scan")
+    @ResponseBody
+    public String scanQrcodeLoginCallback(String eventKey,String wechatId,String openId){
+        log.warn(openId + "推广码扫码回调!");
+        String message = "";
+
+        try {
+            CompanyUser companyUser = companyUserService.findByOpenId(openId);
+
+            if(companyUser!=null) {
+                String[] arr = eventKey.split(",");
+
+                String promoter = arr[1];
+
+                ReplyMessage replyMessage = replyMessageService.findByEvent(wechatId, "promotion");
+
+                StringBuilder urlBuilder = new StringBuilder();
+
+                urlBuilder.append("openId=" + openId);
+                urlBuilder.append("&promoter=" + URLEncoder.encode(promoter, "UTF-8"));
+
+                Map<String, Object> vars = new HashMap<>();
+                vars.put("params", urlBuilder.toString());
+
+                message = VelocityHelper.format(replyMessage.getMessage(), vars);
+            }
+            else{
+                message = "当前用户已注册!";
+            }
+        }
+        catch (Exception ex){
+            log.error(ex.getMessage(),ex);
+            message = ex.getMessage();
+        }
+
+        return message;
+    }
+
     /**
      * 接收扫码登录回调
      * @param eventKey

+ 18 - 3
picc-admin-server/src/main/java/com/jpsoft/picc/modules/business/controller/InsurancePolicyController.java

@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -674,21 +675,35 @@ public class InsurancePolicyController {
         PojoUtils.map(srcPolicy,destPolicy);
 
         DateTime startTime = new DateTime(srcPolicy.getEndTime());
+        DateTime createTime = new DateTime(insuranceApplication.getCreateTime());
+
+        destPolicy.setId(UUID.randomUUID().toString());
+        destPolicy.setNo(srcPolicy.getNo()+1);
+
+        DecimalFormat df = new DecimalFormat("00");
+        destPolicy.setPolicyNo(createTime.toString("yyyyMMddHHmmssSSS") + "-" + df.format(destPolicy.getNo()));
 
         destPolicy.setStartTime(startTime.toDate());
         destPolicy.setEndTime(startTime.plusMonths(1).toDate());
         destPolicy.setEffectiveDate(startTime.toString("yyyyMM"));
+        destPolicy.setStatus(PolicyStatus.Draft.getValue() + "");
+        destPolicy.setCreateTime(new Date());
+        destPolicy.setCreateBy(subject);
+        destPolicy.setUpdateBy(null);
+        destPolicy.setUpdateTime(null);
+        destPolicy.setFinishTime(null);
 
         //todo 如果有则判断关联当前投保单的下月投保记录是否存在
         boolean exist = insurancePolicyService.existByApplicationIdAndEffectiveDate(applicationId, destPolicy.getEffectiveDate());
 
         if (!exist) {
-            //todo 关联投保单及下月投保单
+            insurancePolicyService.insert(destPolicy);
+
+            //todo 关联投保申请单及下月月投保单
             ApplicationPolicy applicationPolicy = new ApplicationPolicy();
+
             applicationPolicy.setId(UUID.randomUUID().toString());
             applicationPolicy.setApplicationId(applicationId);
-
-            //下月投保单已存在(创建时间)<当前投保单创建时间,所以排序要按照start_time
             applicationPolicy.setPolicyId(destPolicy.getId());
 
             applicationPolicyService.insert(applicationPolicy);

+ 20 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/dao/ReplyMessageDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.picc.modules.base.dao;
+
+import com.jpsoft.picc.modules.base.entity.ReplyMessage;
+import com.jpsoft.picc.modules.common.dto.Sort;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+import java.util.Map;
+
+@Repository
+public interface ReplyMessageDAO {
+	int insert(ReplyMessage entity);
+	int update(ReplyMessage entity);
+	int exist(String id);
+	ReplyMessage get(String id);
+	int delete(String id);
+	List<ReplyMessage> list();
+	List<ReplyMessage> search(Map<String, Object> searchParams, List<Sort> sortList);
+	ReplyMessage findByEvent(String wechatId, String event);
+}

+ 35 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/entity/ReplyMessage.java

@@ -0,0 +1,35 @@
+package com.jpsoft.picc.modules.base.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+  描述:wechat_reply_message的实体类
+ */
+@Data
+@ApiModel(value = "自动回复消息设置")
+public class ReplyMessage {
+    @ApiModelProperty(value = "编号")
+	private String id;
+	@ApiModelProperty(value = "微信公众号")
+	private String wechatId;
+    @ApiModelProperty(value = "事件")
+	private String event;
+    @ApiModelProperty(value = "回复消息")
+	private String message;
+
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    @ApiModelProperty(value = "创建时间")
+	private Date createTime;
+
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    @ApiModelProperty(value = "更新时间")
+	private Date updateTime;
+}

+ 19 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/service/ReplyMessageService.java

@@ -0,0 +1,19 @@
+package com.jpsoft.picc.modules.base.service;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.picc.modules.base.entity.ReplyMessage;
+import com.jpsoft.picc.modules.common.dto.Sort;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ReplyMessageService {
+	ReplyMessage get(String id);
+	boolean exist(String id);
+	int insert(ReplyMessage model);
+	int update(ReplyMessage model);
+	int delete(String id);
+	List<ReplyMessage> list();
+	Page<ReplyMessage> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, List<Sort> sortList);
+	ReplyMessage findByEvent(String fromUserName, String event);
+}

+ 75 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/base/service/impl/ReplyMessageServiceImpl.java

@@ -0,0 +1,75 @@
+package com.jpsoft.picc.modules.base.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.jpsoft.picc.modules.base.dao.ReplyMessageDAO;
+import com.jpsoft.picc.modules.base.entity.ReplyMessage;
+import com.jpsoft.picc.modules.base.service.ReplyMessageService;
+import com.jpsoft.picc.modules.common.dto.Sort;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Transactional
+@Component(value="replyMessageService")
+public class ReplyMessageServiceImpl implements ReplyMessageService {
+	@Resource(name="replyMessageDAO")
+	private ReplyMessageDAO replyMessageDAO;
+
+	@Override
+	public ReplyMessage get(String id) {
+		// TODO Auto-generated method stub
+		return replyMessageDAO.get(id);
+	}
+
+	@Override
+	public int insert(ReplyMessage model) {
+		// TODO Auto-generated method stub
+		//model.set${PkFieldName}(UUID.randomUUID().toString());
+		
+		return replyMessageDAO.insert(model);
+	}
+
+	@Override
+	public int update(ReplyMessage model) {
+		// TODO Auto-generated method stub
+		return replyMessageDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return replyMessageDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = replyMessageDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<ReplyMessage> list() {
+		// TODO Auto-generated method stub
+		return replyMessageDAO.list();
+	}
+
+	@Override
+	public Page<ReplyMessage> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
+        Page<ReplyMessage> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
+            replyMessageDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+
+	@Override
+	public ReplyMessage findByEvent(String id, String event) {
+		return replyMessageDAO.findByEvent(id,event);
+	}
+}

+ 20 - 381
picc-common/src/main/java/com/jpsoft/picc/modules/business/entity/InsuranceApplication.java

@@ -1,11 +1,10 @@
 package com.jpsoft.picc.modules.business.entity;
 
-import java.io.Serializable;
 import java.util.Date;
-import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
 
 import com.jpsoft.picc.modules.common.constant.PolicyStatus;
+import lombok.Data;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -15,6 +14,7 @@ import io.swagger.annotations.ApiModel;
 /**
   描述:business_insurance_application的实体类
  */
+@Data
 @ApiModel(value = "business_insurance_application的实体类")
 public class InsuranceApplication {
     @ApiModelProperty(value = "ID")
@@ -53,10 +53,17 @@ public class InsuranceApplication {
 	private String companyAddress;
     @ApiModelProperty(value = "近三年损失情况")
 	private String lossInRecentYears;
+
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "保障开始时间")
 	private Date startTime;
+
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "保障结束时间")
 	private Date endTime;
+
     @ApiModelProperty(value = "保险费合计(总金额)")
 	private BigDecimal insuranceFee;
     @ApiModelProperty(value = "状态:草稿10/待初审20/待复审30/待缴费40/待制单50/待出单60/已出单70/已过期100")
@@ -67,10 +74,16 @@ public class InsuranceApplication {
 	private String processStatus;
     @ApiModelProperty(value = "创建人")
 	private String createBy;
+
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "创建时间")
 	private Date createTime;
     @ApiModelProperty(value = "更新人")
 	private String updateBy;
+
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "更新时间")
 	private Date updateTime;
     @ApiModelProperty(value = "是否删除")
@@ -81,359 +94,14 @@ public class InsuranceApplication {
 	@ApiModelProperty(value = "最新的每月投保单,不写入数据库,作查询使用")
 	private InsurancePolicy insurancePolicy;
 
-	/**
-	 *获取ID
-	 */
-    	public String getId(){
-		return id;
-	}
-	
-	/**
-	 *设置ID
-	 */
-	public void setId(String id){
-		this.id = id;
-	}
-	/**
-	 *获取企业ID
-	 */
-    	public String getCompanyId(){
-		return companyId;
-	}
-	
-	/**
-	 *设置企业ID
-	 */
-	public void setCompanyId(String companyId){
-		this.companyId = companyId;
-	}
-	/**
-	 *获取保险种类
-	 */
-    	public String getDefinitionId(){
-		return definitionId;
-	}
-	
-	/**
-	 *设置保险种类
-	 */
-	public void setDefinitionId(String definitionId){
-		this.definitionId = definitionId;
-	}
-	/**
-	 *获取投保人姓名
-	 */
-    	public String getInsuredName(){
-		return insuredName;
-	}
-	
-	/**
-	 *设置投保人姓名
-	 */
-	public void setInsuredName(String insuredName){
-		this.insuredName = insuredName;
-	}
-	/**
-	 *获取联系电话
-	 */
-    	public String getInsuredTel(){
-		return insuredTel;
-	}
-	
-	/**
-	 *设置联系电话
-	 */
-	public void setInsuredTel(String insuredTel){
-		this.insuredTel = insuredTel;
-	}
-	/**
-	 *获取企业名称
-	 */
-    	public String getCompanyName(){
-		return companyName;
-	}
-	
-	/**
-	 *设置企业名称
-	 */
-	public void setCompanyName(String companyName){
-		this.companyName = companyName;
-	}
-	/**
-	 *获取组织机构代码证
-	 */
-    	public String getUsccCode(){
-		return usccCode;
-	}
-	
-	/**
-	 *设置组织机构代码证
-	 */
-	public void setUsccCode(String usccCode){
-		this.usccCode = usccCode;
-	}
-	/**
-	 *获取营业范围
-	 */
-    	public String getBusinessScope(){
-		return businessScope;
-	}
-	
-	/**
-	 *设置营业范围
-	 */
-	public void setBusinessScope(String businessScope){
-		this.businessScope = businessScope;
-	}
-	/**
-	 *获取行业类型
-	 */
-    	public String getIndustryType(){
-		return industryType;
-	}
-	
-	/**
-	 *设置行业类型
-	 */
-	public void setIndustryType(String industryType){
-		this.industryType = industryType;
-	}
-	/**
-	 *获取联系电话
-	 */
-    	public String getTel(){
-		return tel;
-	}
-	
-	/**
-	 *设置联系电话
-	 */
-	public void setTel(String tel){
-		this.tel = tel;
-	}
-	/**
-	 *获取邮编
-	 */
-    	public String getPostal(){
-		return postal;
-	}
-	
-	/**
-	 *设置邮编
-	 */
-	public void setPostal(String postal){
-		this.postal = postal;
-	}
-	/**
-	 *获取雇员人数
-	 */
-    	public Integer getEmployeesNumber(){
-		return employeesNumber;
-	}
-	
-	/**
-	 *设置雇员人数
-	 */
-	public void setEmployeesNumber(Integer employeesNumber){
-		this.employeesNumber = employeesNumber;
-	}
-	/**
-	 *获取已投保人数
-	 */
-    	public Integer getInsuredNumber(){
-		return insuredNumber;
-	}
-	
-	/**
-	 *设置已投保人数
-	 */
-	public void setInsuredNumber(Integer insuredNumber){
-		this.insuredNumber = insuredNumber;
-	}
-	/**
-	 *获取公司地址
-	 */
-    	public String getCompanyAddress(){
-		return companyAddress;
-	}
-	
-	/**
-	 *设置公司地址
-	 */
-	public void setCompanyAddress(String companyAddress){
-		this.companyAddress = companyAddress;
-	}
-	/**
-	 *获取近三年损失情况
-	 */
-    	public String getLossInRecentYears(){
-		return lossInRecentYears;
-	}
-	
-	/**
-	 *设置近三年损失情况
-	 */
-	public void setLossInRecentYears(String lossInRecentYears){
-		this.lossInRecentYears = lossInRecentYears;
-	}
-	/**
-	 *获取保障开始时间
-	 */
-	@DateTimeFormat(pattern="yyyy-MM-dd")
-	@JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
-		public Date getStartTime(){
-		return startTime;
-	}
-	
-	/**
-	 *设置保障开始时间
-	 */
-	public void setStartTime(Date startTime){
-		this.startTime = startTime;
-	}
-	/**
-	 *获取保障结束时间
-	 */
+	@ApiModelProperty(value = "投保单号")
+	private String policyNo;
+
 	@DateTimeFormat(pattern="yyyy-MM-dd")
 	@JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
-		public Date getEndTime(){
-		return endTime;
-	}
-	
-	/**
-	 *设置保障结束时间
-	 */
-	public void setEndTime(Date endTime){
-		this.endTime = endTime;
-	}
-	/**
-	 *获取保险费合计(总金额)
-	 */
-    	public BigDecimal getInsuranceFee(){
-		return insuranceFee;
-	}
-	
-	/**
-	 *设置保险费合计(总金额)
-	 */
-	public void setInsuranceFee(BigDecimal insuranceFee){
-		this.insuranceFee = insuranceFee;
-	}
-	/**
-	 *获取状态:草稿10/待初审20/待复审30/待缴费40/待制单50/待出单60/已出单70/已过期100
-	 */
-    	public String getStatus(){
-		return status;
-	}
-	
-	/**
-	 *设置状态:草稿10/待初审20/待复审30/待缴费40/待制单50/待出单60/已出单70/已过期100
-	 */
-	public void setStatus(String status){
-		this.status = status;
-	}
-	/**
-	 *获取流程审核状态:正常/回退等
-	 */
-    	public String getProcessStatus(){
-		return processStatus;
-	}
-	
-	/**
-	 *设置流程审核状态:正常/回退等
-	 */
-	public void setProcessStatus(String processStatus){
-		this.processStatus = processStatus;
-	}
-	/**
-	 *获取创建人
-	 */
-    	public String getCreateBy(){
-		return createBy;
-	}
-	
-	/**
-	 *设置创建人
-	 */
-	public void setCreateBy(String createBy){
-		this.createBy = createBy;
-	}
-	/**
-	 *获取创建时间
-	 */
-    	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-		public Date getCreateTime(){
-		return createTime;
-	}
-	
-	/**
-	 *设置创建时间
-	 */
-	public void setCreateTime(Date createTime){
-		this.createTime = createTime;
-	}
-	/**
-	 *获取更新人
-	 */
-    	public String getUpdateBy(){
-		return updateBy;
-	}
-	
-	/**
-	 *设置更新人
-	 */
-	public void setUpdateBy(String updateBy){
-		this.updateBy = updateBy;
-	}
-	/**
-	 *获取更新时间
-	 */
-    	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-		public Date getUpdateTime(){
-		return updateTime;
-	}
-	
-	/**
-	 *设置更新时间
-	 */
-	public void setUpdateTime(Date updateTime){
-		this.updateTime = updateTime;
-	}
-	/**
-	 *获取是否删除
-	 */
-    	public Boolean getDelFlag(){
-		return delFlag;
-	}
-	
-	/**
-	 *设置是否删除
-	 */
-	public void setDelFlag(Boolean delFlag){
-		this.delFlag = delFlag;
-	}
+	@ApiModelProperty(value = "出单时间")
+	private Date finishTime;
 
-	/**
-	 * 险种名称
-	 * @return
-	 */
-	public String getDefinitionName() {
-		return definitionName;
-	}
-
-	public void setDefinitionName(String definitionName) {
-		this.definitionName = definitionName;
-	}
-
-	public String getBusinessNature() {
-		return businessNature;
-	}
-
-	public void setBusinessNature(String businessNature) {
-		this.businessNature = businessNature;
-	}
 
 	/**
 	 * 状态翻译
@@ -456,33 +124,4 @@ public class InsuranceApplication {
 
 		return statusN;
 	}
-
-	public void setStatusN(String statusN){
-		this.statusN = statusN;
-	}
-
-
-	public InsurancePolicy getInsurancePolicy() {
-		return insurancePolicy;
-	}
-
-	public void setInsurancePolicy(InsurancePolicy insurancePolicy) {
-		this.insurancePolicy = insurancePolicy;
-	}
-
-	public String getBusinessNatureN() {
-		return businessNatureN;
-	}
-
-	public void setBusinessNatureN(String businessNatureN) {
-		this.businessNatureN = businessNatureN;
-	}
-
-	public String getCombinePolicyId() {
-		return combinePolicyId;
-	}
-
-	public void setCombinePolicyId(String combinePolicyId) {
-		this.combinePolicyId = combinePolicyId;
-	}
 }

+ 20 - 318
picc-common/src/main/java/com/jpsoft/picc/modules/business/entity/InsurancePolicy.java

@@ -7,6 +7,7 @@ import java.math.BigDecimal;
 
 import com.jpsoft.picc.modules.base.entity.InsuranceAgent;
 import com.jpsoft.picc.modules.common.constant.PolicyStatus;
+import lombok.Data;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -16,6 +17,7 @@ import io.swagger.annotations.ApiModel;
 /**
  描述:business_insurance_policy的实体类
  */
+@Data
 @ApiModel(value = "business_insurance_policy的实体类")
 public class InsurancePolicy {
     @ApiModelProperty(value = "编号")
@@ -32,8 +34,14 @@ public class InsurancePolicy {
     private String processStatus;
     @ApiModelProperty(value = "保险费合计(总金额)")
     private BigDecimal insuranceFee;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "开始时间")
     private Date startTime;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "结束时间")
     private Date endTime;
     @ApiModelProperty(value = "人数")
@@ -60,318 +68,32 @@ public class InsurancePolicy {
     private Boolean delFlag;
     @ApiModelProperty(value = "创建人")
     private String createBy;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
+
     @ApiModelProperty(value = "修改人")
     private String updateBy;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
+
     @ApiModelProperty(value = "投保企业编号")
     private String companyId;
     @ApiModelProperty(value = "最后关联投保申请单编号")
     private String latestApplicationId;
 
-    /**
-     *获取编号
-     */
-    public String getId(){
-        return id;
-    }
-
-    /**
-     *设置编号
-     */
-    public void setId(String id){
-        this.id = id;
-    }
-    /**
-     *获取状态:待制单50/待出单60/已出单70
-     */
-    public String getStatus(){
-        return status;
-    }
-
-    /**
-     *设置状态:待制单50/待出单60/已出单70
-     */
-    public void setStatus(String status){
-        this.status = status;
-    }
-    /**
-     *获取流程审核状态:正常/回退等
-     */
-    public String getProcessStatus(){
-        return processStatus;
-    }
+    @ApiModelProperty(value = "投保单号")
+    private String policyNo;
 
-    /**
-     *设置流程审核状态:正常/回退等
-     */
-    public void setProcessStatus(String processStatus){
-        this.processStatus = processStatus;
-    }
-    /**
-     *获取保险费合计(总金额)
-     */
-    public BigDecimal getInsuranceFee(){
-        return insuranceFee;
-    }
-
-    /**
-     *设置保险费合计(总金额)
-     */
-    public void setInsuranceFee(BigDecimal insuranceFee){
-        this.insuranceFee = insuranceFee;
-    }
-    /**
-     *获取开始时间
-     */
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
-    public Date getStartTime(){
-        return startTime;
-    }
-
-    /**
-     *设置开始时间
-     */
-    public void setStartTime(Date startTime){
-        this.startTime = startTime;
-    }
-    /**
-     *获取结束时间
-     */
-    @DateTimeFormat(pattern="yyyy-MM-dd")
-    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
-    public Date getEndTime(){
-        return endTime;
-    }
-
-    /**
-     *设置结束时间
-     */
-    public void setEndTime(Date endTime){
-        this.endTime = endTime;
-    }
-    /**
-     *获取人数
-     */
-    public Integer getNumber(){
-        return number;
-    }
-
-    /**
-     *设置人数
-     */
-    public void setNumber(Integer number){
-        this.number = number;
-    }
-    /**
-     *获取入账银行
-     */
-    public String getAccountBank(){
-        return accountBank;
-    }
-
-    /**
-     *设置入账银行
-     */
-    public void setAccountBank(String accountBank){
-        this.accountBank = accountBank;
-    }
-    /**
-     *获取出账银行
-     */
-    public String getIssuingBank(){
-        return issuingBank;
-    }
-
-    /**
-     *设置出账银行
-     */
-    public void setIssuingBank(String issuingBank){
-        this.issuingBank = issuingBank;
-    }
-    /**
-     *获取单号
-     */
-    public String getSinglNumber(){
-        return singlNumber;
-    }
-
-    /**
-     *设置单号
-     */
-    public void setSinglNumber(String singlNumber){
-        this.singlNumber = singlNumber;
-    }
-    /**
-     *获取转账时间
-     */
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-    public Date getTransferTime(){
-        return transferTime;
-    }
-
-    /**
-     *设置转账时间
-     */
-    public void setTransferTime(Date transferTime){
-        this.transferTime = transferTime;
-    }
-    /**
-     *获取保险代理人
-     */
-    public String getAgentId(){
-        return agentId;
-    }
-
-    /**
-     *设置保险代理人
-     */
-    public void setAgentId(String agentId){
-        this.agentId = agentId;
-    }
-
-    /**
-     *获取保险代理人
-     */
-    public InsuranceAgent getAgent(){
-        return agent;
-    }
-
-    /**
-     *设置保险代理人
-     */
-    public void setAgent(InsuranceAgent agent){
-        this.agent = agent;
-    }
-    /**
-     *获取投保单附件
-     */
-    public String getInsurancePolicyFile(){
-        return insurancePolicyFile;
-    }
-
-    /**
-     *设置投保单附件
-     */
-    public void setInsurancePolicyFile(String insurancePolicyFile){
-        this.insurancePolicyFile = insurancePolicyFile;
-    }
-    /**
-     *获取当前第几份
-     */
-    public Integer getNo(){
-        return no;
-    }
-
-    /**
-     *设置当前第几份
-     */
-    public void setNo(Integer no){
-        this.no = no;
-    }
-    /**
-     *获取生效年月(yyyyMM)
-     */
-    public String getEffectiveDate(){
-        return effectiveDate;
-    }
-
-    /**
-     *设置生效年月(yyyyMM)
-     */
-    public void setEffectiveDate(String effectiveDate){
-        this.effectiveDate = effectiveDate;
-    }
-    /**
-     *获取是否删除
-     */
-    public Boolean getDelFlag(){
-        return delFlag;
-    }
-
-    /**
-     *设置是否删除
-     */
-    public void setDelFlag(Boolean delFlag){
-        this.delFlag = delFlag;
-    }
-    /**
-     *获取创建人
-     */
-    public String getCreateBy(){
-        return createBy;
-    }
-
-    /**
-     *设置创建人
-     */
-    public void setCreateBy(String createBy){
-        this.createBy = createBy;
-    }
-    /**
-     *获取创建时间
-     */
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-    public Date getCreateTime(){
-        return createTime;
-    }
-
-    /**
-     *设置创建时间
-     */
-    public void setCreateTime(Date createTime){
-        this.createTime = createTime;
-    }
-    /**
-     *获取修改人
-     */
-    public String getUpdateBy(){
-        return updateBy;
-    }
-
-    /**
-     *设置修改人
-     */
-    public void setUpdateBy(String updateBy){
-        this.updateBy = updateBy;
-    }
-    /**
-     *获取修改时间
-     */
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
-    public Date getUpdateTime(){
-        return updateTime;
-    }
-
-    /**
-     *设置修改时间
-     */
-    public void setUpdateTime(Date updateTime){
-        this.updateTime = updateTime;
-    }
-
-    public String getDefinitionName() {
-        return definitionName;
-    }
-
-    public void setDefinitionName(String definitionName) {
-        this.definitionName = definitionName;
-    }
-
-    public String getDefinitionId() {
-        return definitionId;
-    }
-
-    public void setDefinitionId(String definitionId) {
-        this.definitionId = definitionId;
-    }
-
+    @ApiModelProperty(value = "出单时间")
+    private Date finishTime;
 
     /**
      * 状态翻译
@@ -394,24 +116,4 @@ public class InsurancePolicy {
 
         return statusN;
     }
-
-    public void setStatusN(String statusN){
-        this.statusN = statusN;
-    }
-
-    public String getCompanyId() {
-        return companyId;
-    }
-
-    public void setCompanyId(String companyId) {
-        this.companyId = companyId;
-    }
-
-    public String getLatestApplicationId() {
-        return latestApplicationId;
-    }
-
-    public void setLatestApplicationId(String latestApplicationId) {
-        this.latestApplicationId = latestApplicationId;
-    }
 }

+ 83 - 0
picc-common/src/main/resources/mapper/base/ReplyMessage.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.picc.modules.base.dao.ReplyMessageDAO">
+    <resultMap id="ReplyMessageMap" type="com.jpsoft.picc.modules.base.entity.ReplyMessage">
+        <id property="id" column="id_"/>
+        <result property="wechatId" column="wechat_id"/>
+        <result property="event" column="event_"/>
+        <result property="message" column="message_"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.ReplyMessage">
+        <!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+        <![CDATA[
+		insert into wechat_reply_message
+	    (id_,wechat_id,event_,message_,create_time,update_time)
+		values
+		(
+			#{id,jdbcType=VARCHAR}
+			,#{wechatId,jdbcType=VARCHAR}
+			,#{event,jdbcType=VARCHAR}
+			,#{message,jdbcType=VARCHAR}
+			,#{createTime,jdbcType= TIMESTAMP }
+			,#{updateTime,jdbcType= TIMESTAMP }
+		)
+	]]>
+    </insert>
+    <delete id="delete" parameterType="string">
+        delete from wechat_reply_message where id_=#{id,jdbcType=VARCHAR}
+    </delete>
+    <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.ReplyMessage">
+        update wechat_reply_message
+        <set>
+            <if test="wechatId!=null">
+                wechat_id=#{wechatId,jdbcType=VARCHAR},
+            </if>
+            <if test="event!=null">
+                event_=#{event,jdbcType=VARCHAR},
+            </if>
+            <if test="message!=null">
+                message_=#{message,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime!=null">
+                create_time=#{createTime,jdbcType= TIMESTAMP },
+            </if>
+            <if test="updateTime!=null">
+                update_time=#{updateTime,jdbcType= TIMESTAMP },
+            </if>
+        </set>
+        where id_=#{id}
+    </update>
+    <select id="get" parameterType="string" resultMap="ReplyMessageMap">
+        select * from wechat_reply_message where id_=#{0}
+    </select>
+    <select id="exist" parameterType="string" resultType="int">
+        select count(*) from wechat_reply_message where id_=#{0}
+    </select>
+    <select id="list" resultMap="ReplyMessageMap">
+        select * from wechat_reply_message
+    </select>
+    <select id="search" parameterType="hashmap" resultMap="ReplyMessageMap">
+        <![CDATA[
+			select * from wechat_reply_message
+		]]>
+        <where>
+            <if test="searchParams.id != null">
+                and ID_ like #{searchParams.id}
+            </if>
+        </where>
+        <foreach item="sort" collection="sortList" open="order by" separator=",">
+            ${sort.name} ${sort.order}
+        </foreach>
+    </select>
+    <select id="findByEvent" resultMap="ReplyMessageMap">
+        select * from wechat_reply_message where wechat_id=#{wechatId} and event_=#{event} limit 1
+    </select>
+</mapper>

+ 11 - 1
picc-common/src/main/resources/mapper/business/InsuranceApplication.xml

@@ -32,6 +32,8 @@
         <result property="updateTime" column="update_time"/>
         <result property="delFlag" column="del_flag"/>
         <result property="combinePolicyId" column="combine_policy_id"/>
+        <result property="policyNo" column="policy_no"/>
+        <result property="finishTime" column="finish_time"/>
     </resultMap>
     <resultMap id="InsuranceApplicationMap2" extends="InsuranceApplicationMap" type="com.jpsoft.picc.modules.business.entity.InsuranceApplication">
         <association property="businessNatureN"
@@ -50,7 +52,7 @@
 	    (id_,company_id,definition_id,insured_name,insured_tel,company_name,uscc_code,
 	    business_scope,business_nature,industry_type,tel_,postal_,employees_number,insured_number,company_address,
 	    loss_in_recent_years,start_time,end_time,insurance_fee,status_,process_status,create_by,create_time,
-	    update_by,update_time,del_flag,combine_policy_id)
+	    update_by,update_time,del_flag,combine_policy_id,policy_no,finish_time)
 		values
 		(
             #{id,jdbcType=VARCHAR}
@@ -80,6 +82,8 @@
             ,#{updateTime,jdbcType= TIMESTAMP }
             ,#{delFlag,jdbcType= NUMERIC }
             ,#{combinePolicyId,jdbcType=VARCHAR}
+            ,#{policyNo,jdbcType=VARCHAR}
+            ,#{finishTime,jdbcType= TIMESTAMP }
 		)
 	]]>
     </insert>
@@ -167,6 +171,12 @@
             <if test="combinePolicyId!=null">
                 combine_policy_id=#{combinePolicyId,jdbcType=VARCHAR},
             </if>
+            <if test="policyNo!=null">
+                policy_no=#{policyNo,jdbcType=VARCHAR},
+            </if>
+            <if test="finishTime!=null">
+                finish_time=#{finishTime,jdbcType= TIMESTAMP },
+            </if>
         </set>
         where id_=#{id}
     </update>

+ 11 - 1
picc-common/src/main/resources/mapper/business/InsurancePolicy.xml

@@ -28,6 +28,8 @@
         <result property="updateTime" column="update_time" />
         <result property="latestApplicationId" column="latest_application_id"/>
         <result property="companyId" column="company_id"/>
+        <result property="policyNo" column="policy_no"/>
+        <result property="finishTime" column="finish_time"/>
         <association property="agent" column="agent_id" select="com.jpsoft.picc.modules.base.dao.InsuranceAgentDAO.get"></association>
    </resultMap>
     <insert id="insert" parameterType="com.jpsoft.picc.modules.business.entity.InsurancePolicy">
@@ -41,7 +43,7 @@
 	    (id_,definition_id,status_,process_status,insurance_fee,start_time,end_time,
 	    number_,account_bank,issuing_bank,singl_number,transfer_time,
 	    agent_id,insurance_policy_file,no_,effective_date,del_flag,create_by,create_time,update_by,update_time,
-	    company_id,latest_application_id)
+	    company_id,latest_application_id,policy_no,finish_time)
 		values
 		(
             #{id,jdbcType=VARCHAR}
@@ -67,6 +69,8 @@
             ,#{updateTime,jdbcType= TIMESTAMP }
             ,#{companyId,jdbcType=VARCHAR}
             ,#{latestApplicationId,jdbcType=VARCHAR}
+            ,#{policyNo,jdbcType=VARCHAR}
+            ,#{finishTime,jdbcType= TIMESTAMP }
 		)
 	]]>
     </insert>
@@ -142,6 +146,12 @@
             <if test="latestApplicationId!=null">
                 latest_application_id=#{latestApplicationId,jdbcType=VARCHAR},
             </if>
+            <if test="policyNo!=null">
+                policy_no=#{policyNo,jdbcType=VARCHAR},
+            </if>
+            <if test="finishTime!=null">
+                finish_time=#{finishTime,jdbcType= TIMESTAMP },
+            </if>
         </set>
         where id_=#{id}
     </update>

+ 5 - 1
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/InsuranceApplicationController.java

@@ -397,6 +397,7 @@ public class InsuranceApplicationController {
             insurancePolicy.setInsuranceFee(totalAmount);
             insurancePolicy.setNumber(totalNumber);
             insurancePolicy.setNo(1); //首月
+            insurancePolicy.setPolicyNo(insuranceApplication.getPolicyNo()); //首页投保单相同
             insurancePolicy.setEffectiveDate(startTime.toString("yyyyMM"));
 
             insurancePolicy.setStartTime(startTime.toDate());
@@ -455,7 +456,10 @@ public class InsuranceApplicationController {
 
                 insuranceApplication.setDelFlag(false);
                 insuranceApplication.setCreateBy(principal.getName());
-                insuranceApplication.setCreateTime(new Date());
+
+                DateTime createTime = DateTime.now();
+                insuranceApplication.setCreateTime(createTime.toDate());
+                insuranceApplication.setPolicyNo(createTime.toString("yyyyMMddHHmmss") + "-01");
 
                 affectCount = insuranceApplicationService.insert(insuranceApplication);
             }else {

+ 5 - 1
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/auth/controller/InsurancePolicyController.java

@@ -666,6 +666,9 @@ public class InsurancePolicyController {
             if(destApplication==null) {
                 destApplication = insuranceApplication;
                 destApplication.setId(UUID.randomUUID().toString());
+
+                //todo 新增参保申请单号与原参保申请单一致
+                destApplication.setPolicyNo(insuranceApplication.getPolicyNo());
                 destApplication.setCreateTime(new Date());
                 destApplication.setCreateBy(principal.getName());
                 destApplication.setInsuranceFee(new BigDecimal(0));
@@ -681,6 +684,7 @@ public class InsurancePolicyController {
                 InsurancePolicy newPolicy = new InsurancePolicy();
                 newPolicy.setId(UUID.randomUUID().toString());
                 newPolicy.setLatestApplicationId(destApplication.getId());
+                newPolicy.setPolicyNo(insurancePolicy.getPolicyNo()); //由于是用来合并,保持与原投保单一致
 
                 newPolicy.setDelFlag(false);
                 newPolicy.setCreateBy(principal.getName());
@@ -690,7 +694,7 @@ public class InsurancePolicyController {
                 int affectCount = insurancePolicyService.insert(newPolicy);
 
                 if (affectCount > 0) {
-                    //todo 关联投保申请单月每月投保单
+                    //todo 关联投保申请单月每月投保单
                     ApplicationPolicy applicationPolicy = new ApplicationPolicy();
                     applicationPolicy.setId(UUID.randomUUID().toString());
 

+ 43 - 5
picc-enterprise-server/src/main/java/com/jpsoft/picc/modules/pub/controller/PayController.java

@@ -2,9 +2,11 @@ package com.jpsoft.picc.modules.pub.controller;
 
 import cn.hutool.json.JSONObject;
 import com.jpsoft.picc.config.JpCloudConfig;
+import com.jpsoft.picc.modules.base.entity.Company;
+import com.jpsoft.picc.modules.base.entity.CompanyUser;
+import com.jpsoft.picc.modules.base.entity.Message;
 import com.jpsoft.picc.modules.base.entity.TransactionRecord;
-import com.jpsoft.picc.modules.base.service.CompanyService;
-import com.jpsoft.picc.modules.base.service.TransactionRecordService;
+import com.jpsoft.picc.modules.base.service.*;
 import com.jpsoft.picc.modules.business.entity.ApplicationPolicy;
 import com.jpsoft.picc.modules.business.entity.InsuranceApplication;
 import com.jpsoft.picc.modules.business.entity.InsurancePolicy;
@@ -31,6 +33,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.text.DecimalFormat;
 import java.util.*;
 
 /**
@@ -64,6 +67,15 @@ public class PayController {
     @Autowired
     private CompanyService companyService;
 
+    @Autowired
+    private CompanyUserService companyUserService;
+
+    @Autowired
+    private TemplateMessageService templateMessageService;
+
+    @Autowired
+    private MessageService messageService;
+
     @PostMapping(value = "/orderNotifyBack")
     @ResponseBody
     @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
@@ -121,7 +133,33 @@ public class PayController {
                     insuranceApplicationService.update(insuranceApplication);
                 }
 
-                //todo 处理合并投保单
+                //todo 发送微信模板消息
+                InsurancePolicy insurancePolicy = applicationPolicyService.findFirstPolicyByApplicationId(insuranceApplication.getId());
+
+                templateMessageService.sendTemplateMessage(insurancePolicy.getId(),PolicyStatus.PendingPay,PolicyStatus.PendingMakePolicy);
+
+                //todo 发送站内消息通知企业用户(正常缴费荆鹏云会发短信消息给企业用户)
+                CompanyUser companyUser = companyUserService.findByCompanyId(insuranceApplication.getCompanyId());
+
+                if (companyUser!=null){
+                    Message siteMessage = new Message();
+
+                    siteMessage.setId(UUID.randomUUID().toString());
+                    siteMessage.setTitle("缴费成功通知");
+
+                    DecimalFormat df = new DecimalFormat("0.00");
+
+                    siteMessage.setContent("投保单号:" + insuranceApplication.getPolicyNo() + "已缴费成功,共计:"
+                            + df.format(insuranceApplication.getInsuranceFee()) + "元。");
+
+                    siteMessage.setCreateTime(new Date());
+                    siteMessage.setRecipientId(companyUser.getId());
+                    siteMessage.setDelFlag(false);
+
+                    messageService.insert(siteMessage);
+                }
+
+                //todo 处理合并投保单(会将当前投保单设为假删除,放最后处理)
                 processCombinePolicy(insuranceApplication);
 
                 message = "订单已支付";
@@ -199,11 +237,11 @@ public class PayController {
             insurancePolicyService.updatePolicyNumAndAmount(combinePolicy, null);
 
             //todo 因为已合并,将当前投保申请单、当前每月投保单设为false
-            insuranceApplication.setDelFlag(false);
+            insuranceApplication.setDelFlag(true);
             insuranceApplication.setUpdateTime(new Date());
             insuranceApplicationService.update(insuranceApplication);
 
-            firstPolicy.setDelFlag(false);
+            firstPolicy.setDelFlag(true);
             firstPolicy.setUpdateTime(new Date());
             insurancePolicyService.update(firstPolicy);
         }

+ 2 - 1
weixin-middleware/src/main/java/com/jpsoft/weixin/callback/EventCallback.java

@@ -31,7 +31,7 @@ public class EventCallback {
 //        this.message = message;
     }
 
-    public boolean process(String officialAccountId,String openId,String eventKey){
+    public boolean process(String wechatId,String openId,String eventKey){
         boolean result = false;
 
         try {
@@ -53,6 +53,7 @@ public class EventCallback {
 
             List<NameValuePair> list = new ArrayList<NameValuePair>();
             list.add(new BasicNameValuePair("eventKey", eventKey));
+            list.add(new BasicNameValuePair("wechatId", wechatId));
             list.add(new BasicNameValuePair("openId", openId));
 
             UrlEncodedFormEntity entity = new UrlEncodedFormEntity(list, "UTF-8");

+ 3 - 4
weixin-middleware/src/main/java/com/jpsoft/weixin/controller/WeixinController.java

@@ -235,11 +235,10 @@ public class WeixinController {
         list.add(new EventCallback(piccEntScanConfig.getBindingCode(),piccEntScanConfig.getBindingCallbackUrl()));
         list.add(new EventCallback(piccAdminScanConfig.getLoginCode(),piccAdminScanConfig.getLoginCallbackUrl()));
         list.add(new EventCallback(piccAdminScanConfig.getBindingCode(),piccAdminScanConfig.getBindingCallbackUrl()));
+        list.add(new EventCallback(piccAdminScanConfig.getPromotionCode(),piccAdminScanConfig.getPromotionCallbackUrl()));
 
-        PromotionCallback promotionCallback = new PromotionCallback(piccAdminScanConfig.getPromotionCode(),piccAdminScanConfig.getPromotionCallbackUrl());
-        promotionCallback.setReplyMessageService(replyMessageService);
-
-        list.add(promotionCallback);
+//        PromotionCallback promotionCallback = new PromotionCallback(piccAdminScanConfig.getPromotionCode(),piccAdminScanConfig.getPromotionCallbackUrl());
+//        promotionCallback.setReplyMessageService(replyMessageService);
 
         return list;
     }

+ 1 - 1
weixin-middleware/src/main/resources/application-dev.yml

@@ -34,4 +34,4 @@ qrcode:
         bindingCode: "6001"
         bindingCallbackUrl: "http://localhost:8081/picc-admin-server/pub/qrcode/binding/scan"
         promotionCode: "7000"
-        promotionCallbackUrl: " http://vbvczi.natappfree.cc/weixin-middleware/demo"
+        promotionCallbackUrl: "http://localhost:8081/picc-admin-server/pub/qrcode/promotion/scan"

+ 1 - 1
weixin-middleware/src/main/resources/application-production.yml

@@ -35,4 +35,4 @@ qrcode:
         bindingCode: "6001"
         bindingCallbackUrl: "http://picc.jzrccs.com/picc-admin-server/pub/qrcode/binding/scan"
         promotionCode: "7000"
-        promotionCallbackUrl: " http://picc.jzrccs.com/picctg/customReg.html"
+        promotionCallbackUrl: "http://picc.jzrccs.com/picc-admin-server/pub/qrcode/promotion/scan"