| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | |
| | | import com.java110.dto.fee.FeeAttrDto; |
| | | import com.java110.dto.fee.FeeConfigDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.payFeeBatch.PayFeeBatchDto; |
| | | import com.java110.dto.payFee.PayFeeBatchDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.fee.bmo.fee.IFeeBMO; |
| | | import com.java110.intf.fee.IFeeAttrInnerServiceSMO; |
| | |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.po.fee.FeeAttrPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.payFeeBatch.PayFeeBatchPo; |
| | | import com.java110.po.payFee.PayFeeBatchPo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.text.ParseException; |
| | |
| | | import java.util.List; |
| | | |
| | | @Java110Cmd(serviceCode = "fee.saveContractCreateFee") |
| | | public class SaveContractCreateFeeCmd extends AbstractServiceCmdListener { |
| | | public class SaveContractCreateFeeCmd extends Cmd { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveContractCreateFeeCmd.class); |
| | | |
| | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | logger.debug("ServiceDataFlowEvent : {}", event); |
| | | String storeId = cmdDataFlowContext.getReqHeaders().get("store-id"); |
| | | // String storeId = cmdDataFlowContext.getReqHeaders().get("store-id"); |
| | | // String userId = cmdDataFlowContext.getReqHeaders().get("user-id"); |
| | | // reqJson.put("storeId", storeId); |
| | |
| | | reqJson.put("feeFlag", feeConfigDtos.get(0).getFeeFlag()); |
| | | reqJson.put("configEndTime", feeConfigDtos.get(0).getEndTime()); |
| | | |
| | | if (FeeDto.FEE_FLAG_ONCE.equals(feeConfigDtos.get(0).getFeeFlag()) && reqJson.containsKey("endTime")) { |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(feeConfigDtos.get(0).getFeeFlag()) && reqJson.containsKey("endTime")) { |
| | | Date endTime = null; |
| | | Date configEndTime = null; |
| | | try { |
| | |
| | | } |
| | | |
| | | contractDto.setContractId(reqJson.getString("contractId")); |
| | | |
| | | contractDto.setCommunityId(reqJson.getString("communityId")); |
| | | contractDto.setStoreId(storeId); |
| | | //contractDto.setCommunityId(reqJson.getString("communityId")); |
| | | contractDtos = contractInnerServiceSMOImpl.queryContracts(contractDto); |
| | | |
| | | if (contractDtos == null || contractDtos.size() < 1) { |
| | |
| | | curFailRoomCount++; |
| | | feePos.add(BeanConvertUtil.covertBean(feeBMOImpl.addContractFee(contractDtos.get(roomIndex), reqJson, context), PayFeePo.class)); |
| | | if (!StringUtil.isEmpty(contractDtos.get(roomIndex).getObjId())) { |
| | | if (FeeDto.FEE_FLAG_ONCE.equals(reqJson.getString("feeFlag"))) { |
| | | if (!FeeDto.FEE_FLAG_CYCLE.equals(reqJson.getString("feeFlag"))) { |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME, |
| | | reqJson.containsKey("endTime") ? reqJson.getString("endTime") : reqJson.getString("configEndTime"))); |
| | | } |
| | |
| | | paramOut.put("totalRoom", contractDtos.size()); |
| | | paramOut.put("successRoom", contractDtos.size() - failRooms); |
| | | paramOut.put("errorRoom", failRooms); |
| | | responseEntity = new ResponseEntity<>(paramOut.toJSONString(), HttpStatus.OK); |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | context.setResponseEntity( ResultVo.createResponseEntity(paramOut)); |
| | | } |
| | | |
| | | |