| @@ -118,6 +118,24 @@ public class WxProjectConfigController extends BaseController { | |||||
| // | // | ||||
| // } | // } | ||||
| @ApiOperation("查询商场集团列表") | |||||
| @GetMapping(value = "/childMallList") | |||||
| @SystemControllerLog(description = "商场基础数据") | |||||
| @TenantIgnore | |||||
| public ResultData childMallList(@ModelAttribute WxMall wxMall, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getMallList"); | |||||
| try { | |||||
| if(wxMall == null){ | |||||
| wxMall = new WxMall(); | |||||
| } | |||||
| wxMall.setParentTenantId(this.getTenantInfo().getTenantId()); | |||||
| PageInfo<WxMall> page = wxMallService.listAsPage(wxMall, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| }catch (Exception e){ | |||||
| logger.error(e.getMessage(),e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||||
| } | |||||
| } | |||||
| @ApiOperation("查询商场集团列表") | @ApiOperation("查询商场集团列表") | ||||
| @GetMapping(value = "/mallList") | @GetMapping(value = "/mallList") | ||||
| @@ -84,8 +84,22 @@ public class WxCouponController extends BaseController { | |||||
| public ResultData parentCouponList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Boolean isList) { | public ResultData parentCouponList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Boolean isList) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | ||||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | if (wxCoupon == null) wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(getTenantInfo().getParentTenantId()); | |||||
| TenantEntity mallTenantEntity = getTenantInfo(); | |||||
| wxCoupon.setTenantId(mallTenantEntity.getParentTenantId()); | |||||
| wxCoupon.setParentTenantId(null); | wxCoupon.setParentTenantId(null); | ||||
| //平台券 | |||||
| if (EnumCouponType.COUPON_DOUYIN_PLAT.getCode() == wxCoupon.getType()) { | |||||
| //查询已经分配了的parentCouponList | |||||
| WxCouponMall couponMall = new WxCouponMall(); | |||||
| couponMall.updateTenantInfo(wxCoupon); | |||||
| couponMall.setMallTenantId(mallTenantEntity.getTenantId()); | |||||
| List<Long> couponIds = wxCouponMallService.listCouponIds(couponMall); | |||||
| if (null != couponIds && couponIds.size() > 0 ) { | |||||
| wxCoupon.setIds(couponIds); | |||||
| }else { | |||||
| wxCoupon.setId(-1L); | |||||
| } | |||||
| } | |||||
| return couponList(wxCoupon, pageNum, pageSize, isList); | return couponList(wxCoupon, pageNum, pageSize, isList); | ||||
| } | } | ||||
| @@ -13,6 +13,7 @@ import org.apache.ibatis.annotations.Param; | |||||
| public interface WxCouponMallMapper extends CommonMapper<WxCouponMall, Long> { | public interface WxCouponMallMapper extends CommonMapper<WxCouponMall, Long> { | ||||
| List<WxCouponMall> findList(WxCouponMall wxCouponMall); | List<WxCouponMall> findList(WxCouponMall wxCouponMall); | ||||
| List<Long> findCouponIdList(WxCouponMall wxCouponMall); | |||||
| void updateStatus(WxCouponMall wxCouponMall); | void updateStatus(WxCouponMall wxCouponMall); | ||||
| void delteAllByProductId(WxCouponMall wxCouponMall); | void delteAllByProductId(WxCouponMall wxCouponMall); | ||||
| } | } | ||||
| @@ -23,6 +23,7 @@ public interface WxCouponMallService { | |||||
| PageInfo<WxCouponMall> listAsPage(WxCouponMall record, Integer pageIndex, Integer pageSize); | PageInfo<WxCouponMall> listAsPage(WxCouponMall record, Integer pageIndex, Integer pageSize); | ||||
| List<WxCouponMall> list(WxCouponMall wxCouponMall,boolean queryMall); | List<WxCouponMall> list(WxCouponMall wxCouponMall,boolean queryMall); | ||||
| List<Long> listCouponIds(WxCouponMall wxCouponMall); | |||||
| void finised(String tenantId,Long couponId,String mallTenantId); | void finised(String tenantId,Long couponId,String mallTenantId); | ||||
| void unfinised(String tenantId, Long couponId,Integer couponType, String mallTenantId) throws Exception; | void unfinised(String tenantId, Long couponId,Integer couponType, String mallTenantId) throws Exception; | ||||
| @@ -61,6 +61,11 @@ public class WxCouponMallServiceImpl implements WxCouponMallService { | |||||
| return list; | return list; | ||||
| } | } | ||||
| @Override | |||||
| public List<Long> listCouponIds(WxCouponMall wxCouponMall){ | |||||
| return wxCouponMallMapper.findCouponIdList(wxCouponMall); | |||||
| } | |||||
| @Override | @Override | ||||
| public PageInfo<WxCouponMall> listAsPage(WxCouponMall record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxCouponMall> listAsPage(WxCouponMall record, Integer pageIndex, Integer pageSize) { | ||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMallMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMallMapper.findList(record)); | ||||
| @@ -77,6 +77,11 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="findCouponIdList" parameterType="com.iformall.domain.po.WxCouponMall" resultType="Long"> | |||||
| select product_id from wx_coupon_mall | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| <update id = "updateStatus" parameterType="com.iformall.domain.po.WxCouponMall"> | <update id = "updateStatus" parameterType="com.iformall.domain.po.WxCouponMall"> | ||||
| update wx_coupon_mall set status = #{status} where `product_id` = #{productId} | update wx_coupon_mall set status = #{status} where `product_id` = #{productId} | ||||
| and `tenant_id` = #{tenantId} and `mall_tenant_id` = #{mallTenantId} | and `tenant_id` = #{tenantId} and `mall_tenant_id` = #{mallTenantId} | ||||