| @@ -3,8 +3,11 @@ package com.iformall.controller; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCUserTags; | import com.iformall.domain.po.WxCUserTags; | ||||
| import com.iformall.domain.po.WxFlowRecord; | import com.iformall.domain.po.WxFlowRecord; | ||||
| import com.iformall.domain.po.WxMsgRecord; | |||||
| import com.iformall.enums.EnumFlowRecordStatus; | import com.iformall.enums.EnumFlowRecordStatus; | ||||
| import com.iformall.enums.EnumMsgRecordStatus; | |||||
| import com.iformall.service.WxFlowService; | import com.iformall.service.WxFlowService; | ||||
| import com.iformall.service.WxMsgRecordService; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -25,8 +28,8 @@ public class WxFlowAbleController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxFlowService wxFlowService; | private WxFlowService wxFlowService; | ||||
| @Autowired | |||||
| RuntimeService runtimeService; | |||||
| // @Autowired | |||||
| // RuntimeService runtimeService; | |||||
| @ApiOperation(value = "启动流程",notes = "{\"businessId\":\"221178539888607232\",\"businessType\":1,\"remark\":\"意见意见。\",\"taskAssignee\":[{\"taskKey\":\"firstTaskUser\",\"assignee\":\"243650055783841792\"},{\"taskKey\":\"secondTaskUser\",\"assignee\":\"\"}],\"variables\":[{\"key\":\"contractType\",\"value\":\"1\"},{\"key\":\"contractNumber\",\"value\":\"1111\"}]}") | @ApiOperation(value = "启动流程",notes = "{\"businessId\":\"221178539888607232\",\"businessType\":1,\"remark\":\"意见意见。\",\"taskAssignee\":[{\"taskKey\":\"firstTaskUser\",\"assignee\":\"243650055783841792\"},{\"taskKey\":\"secondTaskUser\",\"assignee\":\"\"}],\"variables\":[{\"key\":\"contractType\",\"value\":\"1\"},{\"key\":\"contractNumber\",\"value\":\"1111\"}]}") | ||||
| @PostMapping("/start") | @PostMapping("/start") | ||||
| @@ -35,11 +38,18 @@ public class WxFlowAbleController extends BaseController { | |||||
| return wxFlowService.start(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); | return wxFlowService.start(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); | ||||
| } | } | ||||
| @GetMapping(value = "/del") | |||||
| public ResultData list(String id) { | |||||
| runtimeService.deleteProcessInstance(id, "驳回"); | |||||
| return new ResultData(); | |||||
| } | |||||
| /** | |||||
| * 删除流程 | |||||
| */ | |||||
| // @GetMapping(value = "/del") | |||||
| // public ResultData del(String id,String x) { | |||||
| // if("xll1dxx1314".equals(x)) { | |||||
| // runtimeService.deleteProcessInstance(id, "驳回"); | |||||
| // return new ResultData(); | |||||
| // }else{ | |||||
| // return new ResultData("fail"); | |||||
| // } | |||||
| // } | |||||
| /** | /** | ||||
| * 用户代办列表 | * 用户代办列表 | ||||
| @@ -0,0 +1,63 @@ | |||||
| package com.iformall.controller; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.mq.MqBaseProducer; | |||||
| import com.iformall.service.WxMsgRecordService; | |||||
| import com.iformall.utils.JsonUtil; | |||||
| import io.swagger.annotations.Api; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.List; | |||||
| @RestController | |||||
| @Api(description = "消息记录") | |||||
| @RequestMapping(value = "msgrecord") | |||||
| public class WxMsgRecordController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMsgRecordService wxMsgRecordService; | |||||
| @Autowired | |||||
| private MqBaseProducer mqBaseProducer; | |||||
| /** | |||||
| * 重新发送失败的消息 | |||||
| * @param x | |||||
| * @return | |||||
| */ | |||||
| @GetMapping(value = "/resendMsg") | |||||
| public ResultData resendMsg(String x) { | |||||
| if("xll1dxx1314".equals(x)){ | |||||
| WxMsgRecord msgRecord = new WxMsgRecord(); | |||||
| msgRecord.setMsgStatus(EnumMsgRecordStatus.CONSUME_FAIL.getCode()); | |||||
| List<WxMsgRecord> recordList = wxMsgRecordService.findList(msgRecord); | |||||
| for (WxMsgRecord wxMsgRecord:recordList) { | |||||
| if(EnumMsgRecordType.SMS.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| //短信 | |||||
| mqBaseProducer.sendMessage((WxMsgRecord) JsonUtil.readValue(wxMsgRecord.getMsgJson(),WxMsgRecord.class), EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }else if(EnumMsgRecordType.SMS_CALLBACK.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| //业务短信 | |||||
| mqBaseProducer.sendMessage((WxMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),WxMsg.class), EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }else if(EnumMsgRecordType.EMAIL.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| //邮件 | |||||
| mqBaseProducer.sendMessage((MailMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),MailMsg.class), EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }else if(EnumMsgRecordType.SMART_APP.getCode().equals(wxMsgRecord.getMsgType())){ | |||||
| //微信小程序 | |||||
| mqBaseProducer.sendMessage((SmartAppMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),SmartAppMsg.class), EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| } | |||||
| } | |||||
| return new ResultData(); | |||||
| }else{ | |||||
| return new ResultData("fail"); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -41,30 +41,26 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||||
| Long findTranCardCount(WxCoupon wxCoupon); | Long findTranCardCount(WxCoupon wxCoupon); | ||||
| Long findSubsidyMoney(WxCoupon wxCoupon); | |||||
| String findSubsidyMoney(WxCoupon wxCoupon); | |||||
| //-------卷-------- | //-------卷-------- | ||||
| List<WxCoupon> findCouponSendCount(WxCoupon wxCoupon); | |||||
| List<WxCoupon> findCouponOrderCount(WxCoupon wxCoupon); | List<WxCoupon> findCouponOrderCount(WxCoupon wxCoupon); | ||||
| List<WxCoupon> findCouponGetCount(WxCoupon wxCoupon); | |||||
| List<WxCoupon> findCouponPaymentCount(WxCoupon wxCoupon); | List<WxCoupon> findCouponPaymentCount(WxCoupon wxCoupon); | ||||
| List<WxCoupon> priceCouponSaleCount(WxCoupon wxCoupon); | List<WxCoupon> priceCouponSaleCount(WxCoupon wxCoupon); | ||||
| List<WxCoupon> priceCouponPaymentCount(WxCoupon wxCoupon); | List<WxCoupon> priceCouponPaymentCount(WxCoupon wxCoupon); | ||||
| Long findSumPriceSaleMoney(WxCoupon wxCoupon); | |||||
| Long findSumPricePayMent(WxCoupon wxCoupon); | |||||
| Long findSumSubsidyMoney(WxCoupon wxCoupon); | |||||
| String findSumPriceSaleMoney(WxCoupon wxCoupon); | |||||
| String findSumPricePayMent(WxCoupon wxCoupon); | |||||
| String findSumSubsidyMoney(WxCoupon wxCoupon); | |||||
| //-------砍价-------- | //-------砍价-------- | ||||
| List<WxCoupon> pressSendHistory(WxCoupon wxCoupon); | List<WxCoupon> pressSendHistory(WxCoupon wxCoupon); | ||||
| List<WxCoupon> pressSuccHistory(WxCoupon wxCoupon); | List<WxCoupon> pressSuccHistory(WxCoupon wxCoupon); | ||||
| List<WxCoupon> pressPaymentHistory(WxCoupon wxCoupon); | List<WxCoupon> pressPaymentHistory(WxCoupon wxCoupon); | ||||
| String pressSuccRate(WxCoupon wxCoupon); | String pressSuccRate(WxCoupon wxCoupon); | ||||
| // Long sumSubsidy(WxCoupon wxCoupon); | |||||
| Long sumJoin(WxCoupon wxCoupon); | Long sumJoin(WxCoupon wxCoupon); | ||||
| } | } | ||||
| @@ -107,7 +107,7 @@ public interface WxCouponService { | |||||
| * 查询补贴金额 | * 查询补贴金额 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| Long findSubsidyMoney(WxCoupon wxCoupon); | |||||
| String findSubsidyMoney(WxCoupon wxCoupon); | |||||
| //----------------卷-------------- | //----------------卷-------------- | ||||
| /** | /** | ||||
| @@ -146,9 +146,9 @@ public interface WxCouponService { | |||||
| */ | */ | ||||
| List<WxCoupon> priceCouponPaymentCount(WxCoupon wxCoupon); | List<WxCoupon> priceCouponPaymentCount(WxCoupon wxCoupon); | ||||
| Long findSumPriceSaleMoney(WxCoupon wxCoupon); | |||||
| Long findSumPricePayMent(WxCoupon wxCoupon); | |||||
| Long findSumSubsidyMoney(WxCoupon wxCoupon); | |||||
| String findSumPriceSaleMoney(WxCoupon wxCoupon); | |||||
| String findSumPricePayMent(WxCoupon wxCoupon); | |||||
| String findSumSubsidyMoney(WxCoupon wxCoupon); | |||||
| /** | /** | ||||
| @@ -559,8 +559,8 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | ||||
| wxCUserBasicInfoDto.setTenantId(tenantId); | wxCUserBasicInfoDto.setTenantId(tenantId); | ||||
| try { | try { | ||||
| wxCUserBasicInfoDto.setStartTime(sdf.parse(oneWeekStartdate)); | |||||
| wxCUserBasicInfoDto.setEndTime(sdf.parse(oneWeekEndDate)); | |||||
| wxCUserBasicInfoDto.setStartTime(sdf.parse(oneWeekStartdate+ " 00:00:00")); | |||||
| wxCUserBasicInfoDto.setEndTime(sdf.parse(oneWeekEndDate+ " 23:59:59")); | |||||
| }catch (Exception e){ | }catch (Exception e){ | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| } | } | ||||
| @@ -347,9 +347,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Long findSubsidyMoney(WxCoupon wxCoupon) { | |||||
| Long count = wxCouponMapper.findSubsidyMoney(wxCoupon); | |||||
| return (count==null)?0l:count; | |||||
| public String findSubsidyMoney(WxCoupon wxCoupon) { | |||||
| String count = wxCouponMapper.findSubsidyMoney(wxCoupon); | |||||
| return (count==null)?"0":count; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -379,21 +379,21 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Long findSumPriceSaleMoney(WxCoupon wxCoupon) { | |||||
| Long count = wxCouponMapper.findSumPriceSaleMoney(wxCoupon); | |||||
| return (count==null)?0l:count; | |||||
| public String findSumPriceSaleMoney(WxCoupon wxCoupon) { | |||||
| String count = wxCouponMapper.findSumPriceSaleMoney(wxCoupon); | |||||
| return (count==null)?"0":count; | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Long findSumPricePayMent(WxCoupon wxCoupon) { | |||||
| Long count = wxCouponMapper.findSumPricePayMent(wxCoupon); | |||||
| return (count==null)?0l:count; | |||||
| public String findSumPricePayMent(WxCoupon wxCoupon) { | |||||
| String count = wxCouponMapper.findSumPricePayMent(wxCoupon); | |||||
| return (count==null)?"0":count; | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Long findSumSubsidyMoney(WxCoupon wxCoupon) { | |||||
| Long count = wxCouponMapper.findSumSubsidyMoney(wxCoupon); | |||||
| return (count==null)?0l:count; | |||||
| public String findSumSubsidyMoney(WxCoupon wxCoupon) { | |||||
| String count = wxCouponMapper.findSumSubsidyMoney(wxCoupon); | |||||
| return (count==null)?"0":count; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -78,7 +78,7 @@ | |||||
| </select> | </select> | ||||
| <select id="countUser" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Integer"> | <select id="countUser" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Integer"> | ||||
| select count(DISTINCT uc.c_user_id) from wx_c_user_car uc, wx_c_user_basic_info ubi | |||||
| select count(DISTINCT ubi.id) from wx_c_user_car uc, wx_c_user_basic_info ubi | |||||
| where uc.c_user_id = ubi.id | where uc.c_user_id = ubi.id | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and uc.tenant_id = #{tenantId} | and uc.tenant_id = #{tenantId} | ||||
| @@ -98,10 +98,9 @@ | |||||
| </select> | </select> | ||||
| <select id="queryCarCountHistory" resultType="hashmap" parameterType="hashmap"> | <select id="queryCarCountHistory" resultType="hashmap" parameterType="hashmap"> | ||||
| select count(c.id) count,c.create_time from ( | |||||
| select uc.id,DATE_FORMAT(uc.create_date,'%m/%d') create_time | |||||
| from wx_c_user_car uc, wx_c_user_basic_info ubi where uc.c_user_id = ubi.id and uc.tenant_id = #{tenantId} and ubi.tenant_id = #{tenantId} | |||||
| and uc.create_date between #{startdate} and #{enddate} | |||||
| ) c group by c.create_time order by c.create_time | |||||
| SELECT count(DISTINCT c.id) count, c.create_time FROM | |||||
| (SELECT ubi.id as id, DATE_FORMAT(uc.create_date, '%m/%d') create_time FROM wx_c_user_car uc, wx_c_user_basic_info ubi WHERE uc.c_user_id = ubi.id | |||||
| AND uc.tenant_id = #{tenantId} AND ubi.tenant_id = #{tenantId} AND ubi.create_date BETWEEN #{startdate} AND #{enddate}) c | |||||
| GROUP BY c.create_time ORDER BY c.create_time | |||||
| </select> | </select> | ||||
| </mapper> | </mapper> | ||||
| @@ -713,7 +713,7 @@ | |||||
| where c.type = 100 and c.create_date between #{startdate} and #{enddate} | where c.type = 100 and c.create_date between #{startdate} and #{enddate} | ||||
| </select> | </select> | ||||
| <select id="findSubsidyMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | |||||
| <select id="findSubsidyMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="String"> | |||||
| select sum(round(sc.subsidy/100,2)) from wx_card_info ci | select sum(round(sc.subsidy/100,2)) from wx_card_info ci | ||||
| left join wx_coupon c on c.id = ci.coupon_id | left join wx_coupon c on c.id = ci.coupon_id | ||||
| left join wx_merchant_subsidy sc on sc.coupon_order_id = ci.id | left join wx_merchant_subsidy sc on sc.coupon_order_id = ci.id | ||||
| @@ -860,19 +860,19 @@ | |||||
| group by xtime | group by xtime | ||||
| </select> | </select> | ||||
| <select id="findSumPriceSaleMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | |||||
| <select id="findSumPriceSaleMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="String"> | |||||
| select sum(round(c.sale_price/100,2)) from wx_coupon c,wx_coupon_order wco | select sum(round(c.sale_price/100,2)) from wx_coupon c,wx_coupon_order wco | ||||
| where wco.coupon_id = c.id and wco.coupon_price > 0 | where wco.coupon_id = c.id and wco.coupon_price > 0 | ||||
| and wco.create_date between #{startdate} and #{enddate} | and wco.create_date between #{startdate} and #{enddate} | ||||
| </select> | </select> | ||||
| <select id="findSumPricePayMent" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | |||||
| <select id="findSumPricePayMent" parameterType="com.iformall.domain.po.WxCoupon" resultType="String"> | |||||
| select sum(round(c.sale_price/100,2)) from wx_coupon c,wx_coupon_order wco | select sum(round(c.sale_price/100,2)) from wx_coupon c,wx_coupon_order wco | ||||
| where wco.coupon_id = c.id and wco.coupon_price > 0 and wco.coupon_order_status = 1 | where wco.coupon_id = c.id and wco.coupon_price > 0 and wco.coupon_order_status = 1 | ||||
| and wco.create_date between #{startdate} and #{enddate} | and wco.create_date between #{startdate} and #{enddate} | ||||
| </select> | </select> | ||||
| <select id="findSumSubsidyMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | |||||
| <select id="findSumSubsidyMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="String"> | |||||
| select sum(round(sc.subsidy/100,2)) from wx_coupon c | select sum(round(sc.subsidy/100,2)) from wx_coupon c | ||||
| left join wx_coupon_order wo on wo.coupon_id = c.id | left join wx_coupon_order wo on wo.coupon_id = c.id | ||||
| left join wx_merchant_subsidy sc on sc.coupon_order_id = wo.id | left join wx_merchant_subsidy sc on sc.coupon_order_id = wo.id | ||||