| @@ -3,8 +3,11 @@ package com.iformall.controller; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUserTags; | |||
| import com.iformall.domain.po.WxFlowRecord; | |||
| import com.iformall.domain.po.WxMsgRecord; | |||
| import com.iformall.enums.EnumFlowRecordStatus; | |||
| import com.iformall.enums.EnumMsgRecordStatus; | |||
| import com.iformall.service.WxFlowService; | |||
| import com.iformall.service.WxMsgRecordService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -25,8 +28,8 @@ public class WxFlowAbleController extends BaseController { | |||
| @Autowired | |||
| 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\"}]}") | |||
| @PostMapping("/start") | |||
| @@ -35,11 +38,18 @@ public class WxFlowAbleController extends BaseController { | |||
| 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"); | |||
| } | |||
| } | |||
| } | |||
| @@ -95,7 +95,7 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| @ApiOperation("交易统计") | |||
| @PostMapping("/queryOrderSummary") | |||
| @GetMapping("/queryOrderSummary") | |||
| public ResultData queryOrderSummary() { | |||
| logger.debug("[" + getIpAddr() + "] WxOrderController::queryOrderSummary"); | |||
| @@ -41,7 +41,7 @@ public class WxProfitSharingOrderController extends BaseController { | |||
| } | |||
| @ApiOperation("交易统计") | |||
| @PostMapping("/queryOrderSummary") | |||
| @GetMapping("/queryOrderSummary") | |||
| public ResultData queryOrderSummary() { | |||
| logger.debug("[" + getIpAddr() + "] WxProfitSharingOrderController::queryOrderSummary"); | |||
| @@ -4,13 +4,12 @@ package com.iformall.controller; | |||
| import cn.binarywang.wx.miniapp.api.WxMaService; | |||
| import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; | |||
| import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.AuthIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.enums.EnumMallUserStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.MallRolePermissionService; | |||
| import com.iformall.service.MallUserInfoService; | |||
| @@ -95,6 +94,10 @@ public class WxInfoController extends BaseController { | |||
| if(user == null) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION, retMap); | |||
| } | |||
| if(user.getStatus().equals(EnumMallUserStatus.NOT_VALID.getCode())) { | |||
| logger.error(ErrorCode.USER_IS_LOCKED.getMessage()); | |||
| return new ResultData(ErrorCode.USER_IS_LOCKED); | |||
| } | |||
| if(!mallUserRoleService.checkIsMobileAdmin(user)) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION, retMap); | |||
| @@ -365,7 +365,7 @@ public class WxUserGrantController extends BaseController { | |||
| * 检查用户状态 | |||
| * @return | |||
| */ | |||
| @PostMapping("/checkUserStatus") | |||
| @GetMapping("/checkUserStatus") | |||
| @ApiOperation(value = "判断是否是老用户", notes="") | |||
| public ResultData checkUserStatus() { | |||
| Map resultMap = new HashMap(); | |||
| @@ -384,7 +384,7 @@ public class WxUserGrantController extends BaseController { | |||
| * 检查用户状态 | |||
| * @return | |||
| */ | |||
| @PostMapping("/checkPhoneStatus") | |||
| @GetMapping("/checkPhoneStatus") | |||
| @ApiOperation(value = "判断是否是老用户", notes="") | |||
| public ResultData checkPhoneStatus() { | |||
| Map resultMap = new HashMap(); | |||
| @@ -566,7 +566,7 @@ public class WxUserGrantController extends BaseController { | |||
| * 获取用户折扣率 | |||
| * @return | |||
| */ | |||
| @PostMapping("/getDiscountInfo") | |||
| @GetMapping("/getDiscountInfo") | |||
| @ApiOperation(value = "获取用户折扣率", notes="") | |||
| public ResultData getDiscountInfo() { | |||
| @@ -41,30 +41,26 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||
| Long findTranCardCount(WxCoupon wxCoupon); | |||
| Long findSubsidyMoney(WxCoupon wxCoupon); | |||
| String findSubsidyMoney(WxCoupon wxCoupon); | |||
| //-------卷-------- | |||
| List<WxCoupon> findCouponSendCount(WxCoupon wxCoupon); | |||
| List<WxCoupon> findCouponOrderCount(WxCoupon wxCoupon); | |||
| List<WxCoupon> findCouponGetCount(WxCoupon wxCoupon); | |||
| List<WxCoupon> findCouponPaymentCount(WxCoupon wxCoupon); | |||
| List<WxCoupon> priceCouponSaleCount(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> pressSuccHistory(WxCoupon wxCoupon); | |||
| List<WxCoupon> pressPaymentHistory(WxCoupon wxCoupon); | |||
| String pressSuccRate(WxCoupon wxCoupon); | |||
| // Long sumSubsidy(WxCoupon wxCoupon); | |||
| Long sumJoin(WxCoupon wxCoupon); | |||
| } | |||
| @@ -107,7 +107,7 @@ public interface WxCouponService { | |||
| * 查询补贴金额 | |||
| * @return | |||
| */ | |||
| Long findSubsidyMoney(WxCoupon wxCoupon); | |||
| String findSubsidyMoney(WxCoupon wxCoupon); | |||
| //----------------卷-------------- | |||
| /** | |||
| @@ -146,9 +146,9 @@ public interface WxCouponService { | |||
| */ | |||
| 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.setTenantId(tenantId); | |||
| 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){ | |||
| e.printStackTrace(); | |||
| } | |||
| @@ -347,9 +347,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| } | |||
| @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 | |||
| @@ -379,21 +379,21 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| } | |||
| @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 | |||
| 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 | |||
| 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 | |||
| @@ -78,7 +78,7 @@ | |||
| </select> | |||
| <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 | |||
| <if test=" null != tenantId "> | |||
| and uc.tenant_id = #{tenantId} | |||
| @@ -98,10 +98,9 @@ | |||
| </select> | |||
| <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> | |||
| </mapper> | |||
| @@ -51,7 +51,7 @@ | |||
| `id`,`tenant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_type`, | |||
| `valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`, | |||
| `remark`,`status`,`create_date`,`update_date`,`business`,`support_transfer`,`subsidy_num`,`subsidy_type`, | |||
| `press_limit_num`, `press_limit_hours`, `auto_refund`,subsidy_num | |||
| `press_limit_num`, `press_limit_hours`, `auto_refund` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -713,7 +713,7 @@ | |||
| where c.type = 100 and c.create_date between #{startdate} and #{enddate} | |||
| </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 | |||
| left join wx_coupon c on c.id = ci.coupon_id | |||
| left join wx_merchant_subsidy sc on sc.coupon_order_id = ci.id | |||
| @@ -746,6 +746,9 @@ | |||
| where wc.id = c.id) as sum_subsidy | |||
| from wx_coupon c where c.type = 100 | |||
| <if test="title != null"> | |||
| and c.title = concat('%', #{title},'%') | |||
| </if> | |||
| <if test="id != null"> | |||
| and c.id = #{id} | |||
| </if> | |||
| @@ -769,6 +772,9 @@ | |||
| <if test=" 2 == type "> | |||
| and c.sale_price = 0 | |||
| </if> | |||
| <if test="title != null"> | |||
| and c.title = concat('%', #{title},'%') | |||
| </if> | |||
| <if test="id != null"> | |||
| and c.id = #{id} | |||
| </if> | |||
| @@ -776,8 +782,8 @@ | |||
| </select> | |||
| <select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | |||
| select c.*, | |||
| (select count(wop.id) from wx_coupon wc | |||
| select c.* | |||
| ,(select count(wop.id) from wx_coupon wc | |||
| left join wx_order wo on wo.product_id = wc.id | |||
| left join wx_order_press wop on wop.order_id = wo.id | |||
| where wop.first = 1 and wc.id = c.id) as press_count, | |||
| @@ -807,6 +813,9 @@ | |||
| <if test="id != null"> | |||
| and c.id = #{id} | |||
| </if> | |||
| <if test="title != null"> | |||
| and c.title = concat('%', #{title},'%') | |||
| </if> | |||
| order by c.status asc,c.create_date desc | |||
| </select> | |||
| @@ -840,7 +849,7 @@ | |||
| select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c,wx_coupon_order wco | |||
| where c.type not in(8,9,100) | |||
| and wco.coupon_id = c.id and wco.coupon_order_status = 1 | |||
| and wco.create_date between #{startdate} and #{enddate} | |||
| and wco.update_date between #{startdate} and #{enddate} | |||
| group by xtime | |||
| </select> | |||
| @@ -856,23 +865,23 @@ | |||
| select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c,wx_coupon_order wco | |||
| where c.type not in(8,9,100) | |||
| and wco.coupon_id = c.id and wco.coupon_order_status = 1 and wco.coupon_price > 0 | |||
| and wco.create_date between #{startdate} and #{enddate} | |||
| and wco.update_date between #{startdate} and #{enddate} | |||
| group by xtime | |||
| </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 | |||
| where wco.coupon_id = c.id and wco.coupon_price > 0 | |||
| and wco.create_date between #{startdate} and #{enddate} | |||
| </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 | |||
| 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.update_date between #{startdate} and #{enddate} | |||
| </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 | |||
| 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 | |||
| @@ -115,6 +115,9 @@ | |||
| <if test=" null != couponId and ''!=couponId"> | |||
| and c.coupon_id=#{couponId} | |||
| </if> | |||
| <if test=" null != title and ''!=title"> | |||
| and c.title like concat('%',#{title},'%') | |||
| </if> | |||
| </where> | |||
| </select> | |||