| | |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.coupon.CouponPropertyPoolConfigDto; |
| | | import com.java110.intf.acct.ICouponPropertyPoolConfigV1InnerServiceSMO; |
| | | import com.java110.intf.acct.ICouponPropertyPoolV1InnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.java110.dto.couponPropertyPool.CouponPropertyPoolDto; |
| | | import com.java110.dto.coupon.CouponPropertyPoolDto; |
| | | import java.util.List; |
| | | import java.util.ArrayList; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | @Autowired |
| | | private ICouponPropertyPoolV1InnerServiceSMO couponPropertyPoolV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICouponPropertyPoolConfigV1InnerServiceSMO couponPropertyPoolConfigV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | |
| | | |
| | | if (count > 0) { |
| | | couponPropertyPoolDtos = couponPropertyPoolV1InnerServiceSMOImpl.queryCouponPropertyPools(couponPropertyPoolDto); |
| | | queryConfigs(couponPropertyPoolDtos); |
| | | } else { |
| | | couponPropertyPoolDtos = new ArrayList<>(); |
| | | } |
| | |
| | | |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | private void queryConfigs(List<CouponPropertyPoolDto> couponPropertyPoolDtos) { |
| | | |
| | | if(couponPropertyPoolDtos == null || couponPropertyPoolDtos.size()<1){ |
| | | return ; |
| | | } |
| | | List<String> cppIds = new ArrayList<>(); |
| | | |
| | | for(CouponPropertyPoolDto couponPropertyPoolDto: couponPropertyPoolDtos){ |
| | | cppIds.add(couponPropertyPoolDto.getCppId()); |
| | | } |
| | | |
| | | CouponPropertyPoolConfigDto couponPropertyPoolConfigDto = new CouponPropertyPoolConfigDto(); |
| | | couponPropertyPoolConfigDto.setCouponIds(cppIds.toArray(new String[cppIds.size()])); |
| | | List<CouponPropertyPoolConfigDto> couponPropertyPoolConfigDtos |
| | | = couponPropertyPoolConfigV1InnerServiceSMOImpl.queryCouponPropertyPoolConfigs(couponPropertyPoolConfigDto); |
| | | List<CouponPropertyPoolConfigDto> tmpCouponPropertyPoolConfigDtos = null; |
| | | for(CouponPropertyPoolDto couponPropertyPoolDto: couponPropertyPoolDtos){ |
| | | tmpCouponPropertyPoolConfigDtos = new ArrayList<>(); |
| | | for(CouponPropertyPoolConfigDto couponPropertyPoolConfigDto1: couponPropertyPoolConfigDtos){ |
| | | if(couponPropertyPoolDto.getCppId().equals(couponPropertyPoolConfigDto1.getCouponId())){ |
| | | tmpCouponPropertyPoolConfigDtos.add(couponPropertyPoolConfigDto1); |
| | | } |
| | | } |
| | | couponPropertyPoolDto.setConfigs(tmpCouponPropertyPoolConfigDtos); |
| | | } |
| | | |
| | | } |
| | | } |