| | |
| | | import com.java110.store.bmo.contractTypeTemplate.*; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param storeId 商户ID |
| | | * @param expiration 到期合同标记 1 到期合同 |
| | | * @return |
| | | * @serviceCode /contract/queryContract |
| | | * @path /app/contract/queryContract |
| | | */ |
| | | @RequestMapping(value = "/queryContract", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryContract(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "state", required = false) String state, |
| | | @RequestParam(value = "expiration", required = false) String expiration, |
| | | @RequestParam(value = "objId", required = false) String objId, |
| | | @RequestParam(value = "contractId", required = false) String contractId, |
| | | @RequestParam(value = "contractCode", required = false) String contractCode, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | ContractDto contractDto = new ContractDto(); |
| | | contractDto.setPage(page); |
| | | contractDto.setRow(row); |
| | | contractDto.setStoreId(storeId); |
| | | contractDto.setState(state); |
| | | contractDto.setObjId(objId); |
| | | contractDto.setContractId(contractId); |
| | | contractDto.setContractCode(contractCode); |
| | | //如果是到期合同 |
| | | if ("1".equals(expiration)) { |
| | | contractDto.setNoStates(new String[]{ContractDto.STATE_COMPLAINT, ContractDto.STATE_FAIL}); |
| | | contractDto.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | } |
| | | return getContractBMOImpl.get(contractDto); |
| | | } |
| | | |
| | | /** |
| | | * 合同起草待办 |
| | |
| | | */ |
| | | @RequestMapping(value = "/queryContractType", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryContractType(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "audit", required = false) String audit, |
| | | @RequestParam(value = "typeName", required = false) String typeName, |
| | | @RequestParam(value = "contractTypeId", required = false) String contractTypeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | ContractTypeDto contractTypeDto = new ContractTypeDto(); |
| | | contractTypeDto.setPage(page); |
| | | contractTypeDto.setRow(row); |
| | | contractTypeDto.setAudit(audit); |
| | | contractTypeDto.setTypeName(typeName); |
| | | contractTypeDto.setContractTypeId(contractTypeId); |
| | | contractTypeDto.setStoreId(storeId); |
| | | return getContractTypeBMOImpl.get(contractTypeDto); |
| | | } |
| | |
| | | * @path /app/contract/queryContractTypeSpec |
| | | */ |
| | | @RequestMapping(value = "/queryContractTypeSpec", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryContractTypeSpec(@RequestHeader(value = "store-id") String storeId, |
| | | public ResponseEntity<String> queryContractTypeSpec(@RequestParam(value = "specName", required = false) String specName, |
| | | @RequestParam(value = "specShow", required = false) String specShow, |
| | | @RequestParam(value = "specCd", required = false) String specCd, |
| | | @RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row, |
| | | @RequestParam(value = "contractTypeId") String contractTypeId) { |
| | |
| | | contractTypeSpecDto.setRow(row); |
| | | contractTypeSpecDto.setStoreId(storeId); |
| | | contractTypeSpecDto.setContractTypeId(contractTypeId); |
| | | contractTypeSpecDto.setSpecName(specName); |
| | | contractTypeSpecDto.setSpecShow(specShow); |
| | | contractTypeSpecDto.setSpecCd(specCd); |
| | | return getContractTypeSpecBMOImpl.get(contractTypeSpecDto); |
| | | } |
| | | |
| | |
| | | contractChangePlanPo.setRemark(reqJson.getString("changeRemark")); |
| | | |
| | | List<ContractChangePlanRoomPo> contractChangePlanRoomPos = new ArrayList<>(); |
| | | ContractChangePlanRoomPo contractChangePlanRoomPo = null; |
| | | JSONObject roomInfo = null; |
| | | if (reqJson.containsKey("rooms")) { |
| | | JSONArray rooms = reqJson.getJSONArray("rooms"); |
| | | if (rooms != null && rooms.size() > 0) { |
| | | for (int roomIndex = 0; roomIndex < rooms.size(); roomIndex++) { |
| | | contractChangePlanRoomPos.add(BeanConvertUtil.covertBean(rooms.getJSONObject(roomIndex), ContractChangePlanRoomPo.class)); |
| | | // contractChangePlanRoomPos.add(BeanConvertUtil.covertBean(rooms.getJSONObject(roomIndex), ContractChangePlanRoomPo.class)); |
| | | roomInfo = rooms.getJSONObject(roomIndex); |
| | | contractChangePlanRoomPo = BeanConvertUtil.covertBean(roomInfo, ContractChangePlanRoomPo.class); |
| | | contractChangePlanRoomPo.setRoomName(roomInfo.getString("floorNum") |
| | | + "-" + roomInfo.getString("unitNum") |
| | | + "-" + roomInfo.getString("roomNum")); |
| | | contractChangePlanRoomPos.add(contractChangePlanRoomPo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ContractChangePlanDetailPo contractChangePlanDetailPo = BeanConvertUtil.covertBean(reqJson, ContractChangePlanDetailPo.class); |
| | | contractChangePlanDetailPo.setStoreId(storeId); |
| | | return saveContractChangePlanBMOImpl.save(contractChangePlanPo, contractChangePlanDetailPo,contractChangePlanRoomPos); |
| | | return saveContractChangePlanBMOImpl.save(contractChangePlanPo, contractChangePlanDetailPo, contractChangePlanRoomPos, reqJson); |
| | | } |
| | | |
| | | /** |
| | |
| | | @RequestParam(value = "row") int row, |
| | | @RequestParam(value = "contractId", required = false) String contractId, |
| | | @RequestParam(value = "contractName", required = false) String contractName, |
| | | @RequestParam(value = "contractCode", required = false) String contractCode, |
| | | @RequestParam(value = "contractType", required = false) String contractType, |
| | | @RequestParam(value = "planId", required = false) String planId |
| | | ) { |
| | | ContractChangePlanDto contractChangePlanDto = new ContractChangePlanDto(); |
| | |
| | | contractChangePlanDto.setContractId(contractId); |
| | | contractChangePlanDto.setContractName(contractName); |
| | | contractChangePlanDto.setPlanId(planId); |
| | | contractChangePlanDto.setContractCode(contractCode); |
| | | contractChangePlanDto.setContractType(contractType); |
| | | return getContractChangePlanBMOImpl.get(contractChangePlanDto); |
| | | } |
| | | |
| | |
| | | ContractChangePlanDto contractChangePlanDto = new ContractChangePlanDto(); |
| | | contractChangePlanDto.setTaskId(reqJson.getString("taskId")); |
| | | contractChangePlanDto.setPlanId(reqJson.getString("planId")); |
| | | contractChangePlanDto.setContractId(reqJson.getString("contractId")); |
| | | contractChangePlanDto.setStoreId(storeId); |
| | | contractChangePlanDto.setAuditCode(reqJson.getString("state")); |
| | | contractChangePlanDto.setAuditMessage(reqJson.getString("remark")); |