Merge remote-tracking branch 'origin/xinghong-dev'
| | |
| | | public static final String REL_TYPE_CD_GOODS_COVER = "17000";//商品封面 |
| | | public static final String REL_TYPE_CD_GOODS_CAROUSEL_FIGURE = "18000";//商品轮播 |
| | | public static final String SAVE_WAY_FTP = "ftp";//租赁图片 |
| | | public static final String BEFORE_REPAIR_PHOTOS = "19000"; //维修前图片 |
| | | public static final String AFTER_REPAIR_PHOTOS = "200000"; //维修后图片 |
| | | public static final String BEFORE_REPAIR_PHOTOS = "23000"; //维修前图片 |
| | | public static final String AFTER_REPAIR_PHOTOS = "24000"; //维修后图片 |
| | | |
| | | private String relTypeCd; |
| | | private String[] relTypeCds; |
| | |
| | | public static final String STATE_BACK = "1200"; |
| | | //转单 |
| | | public static final String STATE_TRANSFER = "1300"; |
| | | |
| | | //申请支付 |
| | | public static final String STATE_PAY = "1400"; |
| | | //支付失败 |
| | |
| | | public static final String STATE_UNPROCESSED = "2000"; |
| | | |
| | | public static final String REPAIR_WAY_GRABBING = "100"; //抢单模式 |
| | | public static final String REPAIR_WAY_TRAINING = "300"; //抢单模式 |
| | | public static final String REPAIR_WAY_ASSIGN = "200"; //指派模式 |
| | | public static final String REPAIR_WAY_TRAINING = "300"; //轮训模式 |
| | | |
| | | //报修渠道 D员工代客报修 T电话报修 Z业主自主保修 |
| | | public static final String REPAIR_CHANNEL_STAFF = "D"; //D员工代客报修 |
| | | public static final String REPAIR_CHANNEL_TEL = "T"; //T电话报修 |
| | | public static final String REPAIR_CHANNEL_OWNER = "Z"; //Z业主自主保修 |
| | | |
| | | private String repairName; |
| | | private String appointmentTime; |
| | |
| | | private String startRuId; |
| | | private String preRuId; |
| | | private String ruId; |
| | | |
| | | private String returnVisitFlagName; |
| | | private String publicArea; |
| | | private String repairChannel; |
| | | private String maintenanceType; |
| | | private String reqSource; |
| | | private List<String> repairChannels; |
| | | |
| | | //业主上传维修图片 |
| | | private List<PhotoVo> repairPhotos; |
| | |
| | | public void setAfterPhotos(List<PhotoVo> afterPhotos) { |
| | | this.afterPhotos = afterPhotos; |
| | | } |
| | | |
| | | public String getReturnVisitFlagName() { |
| | | return returnVisitFlagName; |
| | | } |
| | | |
| | | public void setReturnVisitFlagName(String returnVisitFlagName) { |
| | | this.returnVisitFlagName = returnVisitFlagName; |
| | | } |
| | | |
| | | public String getPublicArea() { |
| | | return publicArea; |
| | | } |
| | | |
| | | public void setPublicArea(String publicArea) { |
| | | this.publicArea = publicArea; |
| | | } |
| | | |
| | | public String getRepairChannel() { |
| | | return repairChannel; |
| | | } |
| | | |
| | | public void setRepairChannel(String repairChannel) { |
| | | this.repairChannel = repairChannel; |
| | | } |
| | | |
| | | public String getMaintenanceType() { |
| | | return maintenanceType; |
| | | } |
| | | |
| | | public void setMaintenanceType(String maintenanceType) { |
| | | this.maintenanceType = maintenanceType; |
| | | } |
| | | |
| | | |
| | | public String getReqSource() { |
| | | return reqSource; |
| | | } |
| | | |
| | | public void setReqSource(String reqSource) { |
| | | this.reqSource = reqSource; |
| | | } |
| | | |
| | | public List<String> getRepairChannels() { |
| | | return repairChannels; |
| | | } |
| | | |
| | | public void setRepairChannels(List<String> repairChannels) { |
| | | this.repairChannels = repairChannels; |
| | | } |
| | | } |
| | |
| | | public static final String STATE_TRANSFER = "10004";// 转单 |
| | | public static final String STATE_SUBMIT = "10005";// 提交 |
| | | public static final String STATE_DISPATCH = "10006";//派单 |
| | | public static final String STATE_FINISH = "10007";//评价完成 |
| | | public static final String STATE_FINISH_VISIT = "10008";//已回访 |
| | | public static final String STATE_PAY_FEE = "10009";//待支付 |
| | | public static final String STATE_EVALUATE = "11000";//待评价 |
| | | public static final String STATE_FINISH_PAY_FEE = "12000";//已支付 |
| | | |
| | | |
| | | private String context; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | |
| | | private String resId; |
| | | //10000 采购 20000出库 |
| | | private String resOrderType; |
| | | |
| | | |
| | | //物品类型 |
| | | private String goodsType; |
| | | //物品类型名称 |
| | | private String goodsTypeName; |
| | | //单位 |
| | | private String unitCode; |
| | | //备注 |
| | | private String remark; |
| | | //对外售价最低价格 |
| | | private String outLowPrice; |
| | | //对外收集最高价格 |
| | | private String outHighPrice; |
| | | //对外售价 |
| | | private String outPrice; |
| | | //手机端是否显示(N否 Y是) |
| | | private String showMobile; |
| | | private List<String> fileUrls; |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | |
| | | public void setResOrderType(String resOrderType) { |
| | | this.resOrderType = resOrderType; |
| | | } |
| | | |
| | | public String getGoodsType() { |
| | | return goodsType; |
| | | } |
| | | |
| | | public void setGoodsType(String goodsType) { |
| | | this.goodsType = goodsType; |
| | | } |
| | | |
| | | public String getUnitCode() { |
| | | return unitCode; |
| | | } |
| | | |
| | | public void setUnitCode(String unitCode) { |
| | | this.unitCode = unitCode; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getOutLowPrice() { |
| | | return outLowPrice; |
| | | } |
| | | |
| | | public void setOutLowPrice(String outLowPrice) { |
| | | this.outLowPrice = outLowPrice; |
| | | } |
| | | |
| | | public String getOutHighPrice() { |
| | | return outHighPrice; |
| | | } |
| | | |
| | | public void setOutHighPrice(String outHighPrice) { |
| | | this.outHighPrice = outHighPrice; |
| | | } |
| | | |
| | | public String getOutPrice() { |
| | | return outPrice; |
| | | } |
| | | |
| | | public void setOutPrice(String outPrice) { |
| | | this.outPrice = outPrice; |
| | | } |
| | | |
| | | public String getShowMobile() { |
| | | return showMobile; |
| | | } |
| | | |
| | | public void setShowMobile(String showMobile) { |
| | | this.showMobile = showMobile; |
| | | } |
| | | |
| | | public String getGoodsTypeName() { |
| | | return goodsTypeName; |
| | | } |
| | | |
| | | public void setGoodsTypeName(String goodsTypeName) { |
| | | this.goodsTypeName = goodsTypeName; |
| | | } |
| | | |
| | | public List<String> getFileUrls() { |
| | | return fileUrls; |
| | | } |
| | | |
| | | public void setFileUrls(List<String> fileUrls) { |
| | | this.fileUrls = fileUrls; |
| | | } |
| | | } |
| | |
| | | public static final String SPEC_CD_WECHAT_HOUSE_DECORATION_CHECK_TEMPLATE = "33013";//装修审核/完成提醒给物业管理人员 |
| | | public static final String SPEC_CD_WECHAT_HOUSE_DECORATION_CHECK_RESULT_TEMPLATE = "33014";//装修审核结果提醒给业主 |
| | | public static final String SPEC_CD_WECHAT_HOUSE_DECORATION_COMPLETED_TEMPLATE = "33015";//装修验收结果提醒给业主 |
| | | public static final String SPEC_CD_WECHAT_REPAIR_CHARGE_SCENE_TEMPLATE = "33016";//报修通知-上门维修现场收费通知业主 |
| | | |
| | | private String attrId; |
| | | private String wechatId; |
| | |
| | | private String roomId; |
| | | private String appointmentTime; |
| | | private String context; |
| | | |
| | | private String state; |
| | | |
| | | private String repairObjType; |
| | | private String repairObjId; |
| | | private String repairObjName; |
| | | private String maintenanceType; |
| | | private String repairChannel; |
| | | private String bId; |
| | | private String statusCd ; |
| | | |
| | | |
| | |
| | | this.repairObjName = repairObjName; |
| | | } |
| | | |
| | | public String getMaintenanceType() { |
| | | return maintenanceType; |
| | | } |
| | | |
| | | public void setMaintenanceType(String maintenanceType) { |
| | | this.maintenanceType = maintenanceType; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | |
| | | |
| | | public String getRepairChannel() { |
| | | return repairChannel; |
| | | } |
| | | |
| | | public void setRepairChannel(String repairChannel) { |
| | | this.repairChannel = repairChannel; |
| | | } |
| | | |
| | | public String getbId() { |
| | | return bId; |
| | | } |
| | | |
| | | public void setbId(String bId) { |
| | | this.bId = bId; |
| | | } |
| | | |
| | | } |
| | |
| | | private String communityId; |
| | | private String state; |
| | | private String context; |
| | | |
| | | private String staffId; |
| | | private String staffName; |
| | | private String preStaffId; |
| | |
| | | private String startTime; |
| | | private String endTime; |
| | | private String repairEvent; |
| | | private String createTime; |
| | | private String bId; |
| | | private String statusCd = "0"; |
| | | |
| | | public String getRuId() { |
| | | return ruId; |
| | |
| | | public void setPreRuId(String preRuId) { |
| | | this.preRuId = preRuId; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getbId() { |
| | | return bId; |
| | | } |
| | | |
| | | public void setbId(String bId) { |
| | | this.bId = bId; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| | |
| | | package com.java110.po.purchase; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName ResourceStorePo |
| | |
| | | private String description; |
| | | private String price; |
| | | private String stock; |
| | | private String statusCd; |
| | | private String statusCd = "0"; |
| | | private String goodsType; |
| | | private String unitCode; |
| | | private String remark; |
| | | private String outLowPrice; |
| | | private String outHighPrice; |
| | | private String showMobile; |
| | | private String createTime; |
| | | private String bId; |
| | | private List<String> photos; |
| | | private List<String> fileUrls; |
| | | |
| | | public String getResId() { |
| | | return resId; |
| | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | |
| | | public String getGoodsType() { |
| | | return goodsType; |
| | | } |
| | | |
| | | public void setGoodsType(String goodsType) { |
| | | this.goodsType = goodsType; |
| | | } |
| | | |
| | | public String getUnitCode() { |
| | | return unitCode; |
| | | } |
| | | |
| | | public void setUnitCode(String unitCode) { |
| | | this.unitCode = unitCode; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getOutLowPrice() { |
| | | return outLowPrice; |
| | | } |
| | | |
| | | public void setOutLowPrice(String outLowPrice) { |
| | | this.outLowPrice = outLowPrice; |
| | | } |
| | | |
| | | public String getOutHighPrice() { |
| | | return outHighPrice; |
| | | } |
| | | |
| | | public void setOutHighPrice(String outHighPrice) { |
| | | this.outHighPrice = outHighPrice; |
| | | } |
| | | |
| | | public String getShowMobile() { |
| | | return showMobile; |
| | | } |
| | | |
| | | public void setShowMobile(String showMobile) { |
| | | this.showMobile = showMobile; |
| | | } |
| | | |
| | | public String getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(String createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getbId() { |
| | | return bId; |
| | | } |
| | | |
| | | public void setbId(String bId) { |
| | | this.bId = bId; |
| | | } |
| | | |
| | | public List<String> getPhotos() { |
| | | return photos; |
| | | } |
| | | |
| | | public void setPhotos(List<String> photos) { |
| | | this.photos = photos; |
| | | } |
| | | |
| | | public List<String> getFileUrls() { |
| | | return fileUrls; |
| | | } |
| | | |
| | | public void setFileUrls(List<String> fileUrls) { |
| | | this.fileUrls = fileUrls; |
| | | } |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public class ApiResourceStoreDataVo implements Serializable { |
| | | |
| | |
| | | private String price; |
| | | private String stock; |
| | | private String description; |
| | | //物品类型 |
| | | private String goodsType; |
| | | //物品类型名称 |
| | | private String goodsTypeName; |
| | | //单位 |
| | | private String unitCode; |
| | | //备注 |
| | | private String remark; |
| | | //对外售价最低价格 |
| | | private String outLowPrice; |
| | | //对外收集最高价格 |
| | | private String outHighPrice; |
| | | //对外售价 |
| | | private String outPrice; |
| | | //手机端是否显示(N否 Y是) |
| | | private String showMobile; |
| | | private Date createTime; |
| | | private List<String> fileUrls; |
| | | |
| | | public String getResId() { |
| | | return resId; |
| | |
| | | this.description = description; |
| | | } |
| | | |
| | | public String getGoodsType() { |
| | | return goodsType; |
| | | } |
| | | |
| | | public void setGoodsType(String goodsType) { |
| | | this.goodsType = goodsType; |
| | | } |
| | | |
| | | public String getUnitCode() { |
| | | return unitCode; |
| | | } |
| | | |
| | | public void setUnitCode(String unitCode) { |
| | | this.unitCode = unitCode; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getOutLowPrice() { |
| | | return outLowPrice; |
| | | } |
| | | |
| | | public void setOutLowPrice(String outLowPrice) { |
| | | this.outLowPrice = outLowPrice; |
| | | } |
| | | |
| | | public String getOutHighPrice() { |
| | | return outHighPrice; |
| | | } |
| | | |
| | | public void setOutHighPrice(String outHighPrice) { |
| | | this.outHighPrice = outHighPrice; |
| | | } |
| | | |
| | | public String getOutPrice() { |
| | | return outPrice; |
| | | } |
| | | |
| | | public void setOutPrice(String outPrice) { |
| | | this.outPrice = outPrice; |
| | | } |
| | | |
| | | public String getShowMobile() { |
| | | return showMobile; |
| | | } |
| | | |
| | | public void setShowMobile(String showMobile) { |
| | | this.showMobile = showMobile; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getGoodsTypeName() { |
| | | return goodsTypeName; |
| | | } |
| | | |
| | | public void setGoodsTypeName(String goodsTypeName) { |
| | | this.goodsTypeName = goodsTypeName; |
| | | } |
| | | |
| | | public List<String> getFileUrls() { |
| | | return fileUrls; |
| | | } |
| | | |
| | | public void setFileUrls(List<String> fileUrls) { |
| | | this.fileUrls = fileUrls; |
| | | } |
| | | } |
| | |
| | | public static final String CODE_PREFIX_planId = "24"; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 只有在不调用服务生成ID时有用 |
| | | */ |
| | |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getPsId(String prefix) throws GenerateCodeException { |
| | | if (!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))) { |
| | | return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefix); |
| | | } |
| | | |
| | | /** |
| | | * 获取资源ID |
| | | * |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getResId(String prefix) throws GenerateCodeException { |
| | | if (!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))) { |
| | | return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefix); |
| | | } |
| | | |
| | | /** |
| | | * 生成费用id |
| | | * |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getFeeId(String prefix) throws GenerateCodeException { |
| | | if (!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))) { |
| | | return prefix + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%04d"); |
| | | } |
| | |
| | | //调用服务 |
| | | return getCode(prefixMap.get("pgId")); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取restTemplate |
| | |
| | | } |
| | | feeReceiptDetailPo.setArea(value); |
| | | feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount()); |
| | | }else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto(); |
| | | parkingSpaceDto.setCommunityId(feeDto.getCommunityId()); |
| | | parkingSpaceDto.setPsId(ownerCarDtos.get(0).getPsId()); |
| | |
| | | } |
| | | } else if ("6006".equals(computingFormula)) { |
| | | feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount())); |
| | | }else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeRoomCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto,FeeDto.class), BeanConvertUtil.covertBean(reportRoomDto,RoomDto.class)); |
| | | } else { |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeRoomCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class), BeanConvertUtil.covertBean(reportRoomDto, RoomDto.class)); |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(tmpReportFeeDto.getPayerObjType())) {//车位相关 |
| | |
| | | } |
| | | } else if ("6006".equals(computingFormula)) { |
| | | feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount())); |
| | | }else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeCarCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto,FeeDto.class), BeanConvertUtil.covertBean(reportCarDto,OwnerCarDto.class)); |
| | | } else { |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeCarCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class), BeanConvertUtil.covertBean(reportCarDto, OwnerCarDto.class)); |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | | } |
| | |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeRoomCustomizeFormula(feeDto, roomDto); |
| | | } else if ("8008".equals(computingFormula)) { //手动动态费用 |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | |
| | | } |
| | | } else if ("6006".equals(computingFormula)) { |
| | | feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount())); |
| | | }else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | } else if ("7007".equals(computingFormula)) { //自定义公式 |
| | | feePrice = computeCarCustomizeFormula(feeDto, ownerCarDtos.get(0)); |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * C 代表房屋对应小区面积 |
| | | |
| | | * R 代表房屋面积 |
| | | * C 代表房屋对应小区面积 |
| | | * <p> |
| | | * R 代表房屋面积 |
| | | * |
| | | * @param feeDto |
| | | * @param ownerCarDto |
| | | * @return |
| | |
| | | if (parkingSpaceDtos == null || parkingSpaceDtos.size() < 1) { //数据有问题 |
| | | //throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "未查到停车位信息,查询多条数据"); |
| | | value = value.replace("R", "0"); |
| | | }else { |
| | | } else { |
| | | value = value.replace("R", parkingSpaceDtos.get(0).getArea()); |
| | | } |
| | | } |
| | |
| | | valueObj = new BigDecimal(0); |
| | | } |
| | | |
| | | if(valueObj.doubleValue() < 0){ |
| | | if (valueObj.doubleValue() < 0) { |
| | | return new BigDecimal(0); |
| | | } |
| | | |
| | |
| | | valueObj = new BigDecimal(0); |
| | | } |
| | | |
| | | if(valueObj.doubleValue() < 0){ |
| | | if (valueObj.doubleValue() < 0) { |
| | | return new BigDecimal(0); |
| | | } |
| | | |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="appraiseServiceDaoImpl"> |
| | | |
| | | |
| | | <!-- 保存评价信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveAppraiseInfo" parameterType="Map"> |
| | | insert into appraise( |
| | |
| | | #{parentAppraiseId},#{appraiseUserName},#{appraiseId},#{appraiseScore},#{appraiseType},#{context},#{objId},#{objType},#{appraiseUserId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询评价信息 add by wuxw 2018-07-03 --> |
| | | <select id="getAppraiseInfo" parameterType="Map" resultType="Map"> |
| | |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 修改评价信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateAppraiseInfo" parameterType="Map"> |
| | |
| | | <if test="appraiseId !=null and appraiseId != ''"> |
| | | and t.appraise_id= #{appraiseId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询评价数量 add by wuxw 2018-07-03 --> |
| | |
| | | <if test="appraiseUserId !=null and appraiseUserId != ''"> |
| | | and t.appraise_user_id= #{appraiseUserId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | <insert id="saveFileRel" parameterType="Map"> |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="deleteFileRel" parameterType="Map"> |
| | | <update id="deleteFileRel" parameterType="Map"> |
| | | update file_rel t set t.status_cd = '1' |
| | | where 1=1 |
| | | <if test="relTypeCd !=null and relTypeCd != ''"> |
| | |
| | | <if test="fileRelId !=null and fileRelId != ''"> |
| | | and t.file_rel_id= #{fileRelId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询文件存放信息 add by wuxw 2018-07-03 --> |
| | | <select id="getFileRelInfo" parameterType="Map" resultType="Map"> |
| | |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 修改文件存放信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateFileRelInfoInstance" parameterType="Map"> |
| | |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询文件存放数量 add by wuxw 2018-07-03 --> |
| | |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!-- 查询小区信息 add by wuxw 2018-07-03 --> |
| | | <select id="getCommunityInfoNew" parameterType="Map" resultType="Map"> |
| | | select t.address,t.nearby_landmarks,t.nearby_landmarks nearbyLandmarks, |
| | | t.city_code,t.city_code cityCode,t.name,t.status_cd,t.status_cd statusCd, |
| | | t.city_code,t.city_code cityCode,t.name,t.status_cd,t.status_cd statusCd,t.tel, |
| | | t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.map_y,t.map_y mapY, |
| | | t.map_x,t.map_x mapX,t.state,(CASE |
| | | WHEN t.state='1000' |
| | |
| | | <!-- 保存报修信息信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessRepairInfo" parameterType="Map"> |
| | | insert into business_repair_pool( |
| | | operate,repair_name,appointment_time,repair_type,context,repair_id,tel,state,community_id,b_id,repair_obj_type,repair_obj_id,repair_obj_name |
| | | operate,repair_name,appointment_time,repair_type,context,repair_id,tel,state,community_id,b_id,repair_obj_type,repair_obj_id, |
| | | repair_obj_name, maintenance_type,repair_channel |
| | | ) values ( |
| | | #{operate},#{repairName},#{appointmentTime},#{repairType},#{context},#{repairId},#{tel},#{state},#{communityId},#{bId}, |
| | | #{repairObjType},#{repairObjId},#{repairObjName} |
| | | #{repairObjType},#{repairObjId},#{repairObjName},#{maintenanceType},#{repairChannel} |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id |
| | | repairId,t.tel,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId, |
| | | t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_obj_type repairObjType,t.repair_obj_id |
| | | repairObjId,t.repair_obj_name repairObjName |
| | | repairObjId,t.repair_obj_name repairObjName,t.maintenance_type,t.maintenance_type maintenanceType, |
| | | t.repair_channel,t.repair_channel repairChannel |
| | | from business_repair_pool t |
| | | where 1 =1 |
| | | <if test="operate !=null and operate != ''"> |
| | |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="maintenanceType !=null and maintenanceType != ''"> |
| | | and t.maintenance_type= #{maintenanceType} |
| | | </if> |
| | | <if test="repairChannel !=null and repairChannel != ''"> |
| | | and t.repair_channel= #{repairChannel} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | |
| | | <insert id="saveRepairInfoInstance" parameterType="Map"> |
| | | insert into r_repair_pool( |
| | | repair_name,appointment_time,repair_type,context,repair_id,tel,status_cd,state,community_id,b_id, |
| | | repair_obj_type,repair_obj_id,repair_obj_name |
| | | repair_obj_type,repair_obj_id,repair_obj_name,repair_channel,maintenance_type |
| | | ) select |
| | | t.repair_name,t.appointment_time,t.repair_type,t.context,t.repair_id,t.tel,'0',t.state,t.community_id,t.b_id, |
| | | t.repair_obj_type,t.repair_obj_id,t.repair_obj_name |
| | | t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_channel,t.maintenance_type |
| | | from business_repair_pool t where 1=1 |
| | | and t.operate= 'ADD' |
| | | <if test="repairName !=null and repairName != ''"> |
| | |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="repairChannel !=null and repairChannel != ''"> |
| | | and t.repair_channel= #{repairChannel} |
| | | </if> |
| | | <if test="maintenanceType !=null and maintenanceType != ''"> |
| | | and t.maintenance_type= #{maintenanceType} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | |
| | | select t.repair_name,t.repair_name repairName,t.appointment_time,t.appointment_time |
| | | appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id |
| | | repairId,t.tel,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id |
| | | bId, |
| | | d.name stateName, |
| | | bId, d.name stateName,t.maintenance_type maintenanceType,t.repair_channel repairChannel, |
| | | rs.repair_type_name repairTypeName,rs.repair_way repairWay,rs.return_visit_flag returnVisitFlag, |
| | | t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_obj_type repairObjType,t.repair_obj_id repairObjId, |
| | | t.repair_obj_name repairObjName |
| | |
| | | <if test="repairObjId !=null and repairObjId != ''"> |
| | | and t.repair_obj_id= #{repairObjId} |
| | | </if> |
| | | <if test="repairChannel !=null and repairChannel != ''"> |
| | | and t.repair_channel= #{repairChannel} |
| | | </if> |
| | | <if test="maintenanceType !=null and maintenanceType != ''"> |
| | | and t.maintenance_type= #{maintenanceType} |
| | | </if> |
| | | <if test="repairChannels !=null"> |
| | | and t.repair_channel in |
| | | <foreach collection="repairChannels" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <!-- 修改报修信息信息 add by wuxw 2018-07-03 --> |
| | |
| | | <if test="repairObjName !=null and repairObjName != ''"> |
| | | , t.repair_obj_name= #{repairObjName} |
| | | </if> |
| | | <if test="maintenanceType !=null and maintenanceType != ''"> |
| | | , t.maintenance_type= #{maintenanceType} |
| | | </if> |
| | | where 1=1 |
| | | <if test="repairId !=null and repairId != ''"> |
| | | and t.repair_id= #{repairId} |
| | |
| | | <select id="queryRepairsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from r_repair_pool t |
| | | left join r_repair_setting rs on rs.repair_type = t.repair_type and rs.status_cd = '0' |
| | | <if test="staffId != null and staffId != ''"> |
| | | ,r_repair_user rru |
| | | ,t_dict td |
| | |
| | | <if test="repairObjId !=null and repairObjId != ''"> |
| | | and t.repair_obj_id= #{repairObjId} |
| | | </if> |
| | | <if test="repairChannels !=null"> |
| | | and t.repair_channel in |
| | | <foreach collection="repairChannels" item="item" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询报修信息信息 add by wuxw 2018-07-03 --> |
| | |
| | | appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id |
| | | repairId,t.tel,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id |
| | | bId,ru.pre_staff_id preStaffId,ru.pre_staff_name preStaffName, |
| | | d.name stateName, |
| | | rs.repair_type_name repairTypeName,rs.repair_way repairWay, |
| | | t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_obj_type repairObjType,t.repair_obj_id repairObjId,t.repair_obj_name repairObjName, |
| | | sru.ru_id startRuId,ru.ru_id ruId,ru.pre_ru_id preRuId |
| | | d.name stateName,rs.return_visit_flag returnVisitFlag,td.name returnVisitFlagName, |
| | | rs.repair_type_name repairTypeName,rs.repair_way repairWay,rs.public_area publicArea, |
| | | t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_obj_type repairObjType,t.repair_obj_id |
| | | repairObjId,t.repair_obj_name repairObjName,t.repair_channel repairChannel, |
| | | sru.ru_id startRuId,ru.ru_id ruId,ru.pre_ru_id preRuId,t.maintenance_type,t.maintenance_type maintenanceType, |
| | | t.repair_channel,t.repair_channel repairChannel |
| | | from r_repair_pool t |
| | | left join t_dict d on t.state = d.status_cd and d.table_name = 'r_repair_pool' and d.table_columns = 'state' |
| | | left join r_repair_setting rs on rs.repair_type = t.repair_type and rs.status_cd = '0' |
| | | left join r_repair_user ru on t.repair_id = ru.repair_id and ru.status_cd = 0 |
| | | left join r_repair_user sru on sru.repair_id = ru.repair_id and sru.status_cd = 0 and sru.state = '10005' |
| | | left join t_dict td on rs.return_visit_flag = td.status_cd and td.table_name='r_repair_setting' and |
| | | td.table_columns='return_visit_flag' |
| | | where 1 =1 |
| | | and ru.end_time is null |
| | | and ru.state = '10001' |
| | | and ru.staff_id = #{staffId} |
| | | and ru.state in ('10001','10002') and t.state |
| | | in('1000','1100','1200','1300','1400','1700','1800') |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and ru.staff_id = #{staffId} |
| | | </if> |
| | | <if test="repairName !=null and repairName != ''"> |
| | | and t.repair_name= #{repairName} |
| | | </if> |
| | |
| | | left join t_dict d on t.state = d.status_cd and d.table_name = 'r_repair_pool' and d.table_columns = 'state' |
| | | left join r_repair_setting rs on rs.repair_type = t.repair_type and rs.status_cd = '0' |
| | | left join r_repair_user ru on t.repair_id = ru.repair_id and t.status_cd = 0 |
| | | left join t_dict td on rs.return_visit_flag = td.status_cd and td.table_name='r_repair_setting' and |
| | | td.table_columns='return_visit_flag' |
| | | where 1 =1 |
| | | and ru.end_time is null |
| | | and ru.state = '10001' |
| | | and ru.staff_id = #{staffId} |
| | | and ru.state in ('10001','10002') and t.state |
| | | in('1000','1100','1200','1300','1400','1700','1800') |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and ru.staff_id = #{staffId} |
| | | </if> |
| | | <if test="repairName !=null and repairName != ''"> |
| | | and t.repair_name= #{repairName} |
| | | </if> |
| | |
| | | select distinct t.repair_name,t.repair_name repairName,t.appointment_time,t.appointment_time |
| | | appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id |
| | | repairId,t.tel,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id |
| | | bId, |
| | | d.name stateName, |
| | | rs.repair_type_name repairTypeName,rs.repair_way repairWay, |
| | | bId,d.name stateName, rs.repair_type_name repairTypeName,rs.repair_way repairWay, |
| | | rs.return_visit_flag returnVisitFlag,td.name returnVisitFlagName, |
| | | t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_obj_type repairObjType,t.repair_obj_id |
| | | repairObjId,t.repair_obj_name repairObjName |
| | | repairObjId,t.repair_obj_name repairObjName,t.maintenance_type,t.maintenance_type maintenanceType, |
| | | t.repair_channel,t.repair_channel repairChannel |
| | | from r_repair_pool t |
| | | left join t_dict d on t.state = d.status_cd and d.table_name = 'r_repair_pool' and d.table_columns = 'state' |
| | | left join r_repair_setting rs on rs.repair_type = t.repair_type and rs.status_cd = '0' |
| | | left join r_repair_user ru on t.repair_id = ru.repair_id and t.status_cd = 0 |
| | | left join r_repair_user ru on t.repair_id = ru.repair_id and t.status_cd = '0' |
| | | left join t_dict td on rs.return_visit_flag = td.status_cd and td.table_name='r_repair_setting' and |
| | | td.table_columns='return_visit_flag' |
| | | where 1 =1 |
| | | and ru.state in ('10002','10003','10004','10005') |
| | | and ru.staff_id = #{staffId} |
| | | and ru.state in ('10002','10003','10004','10005','10009','11000','12000') |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and ru.staff_id = #{staffId} |
| | | </if> |
| | | <if test="repairName !=null and repairName != ''"> |
| | | and t.repair_name= #{repairName} |
| | | </if> |
| | |
| | | left join r_repair_setting rs on rs.repair_type = t.repair_type and rs.status_cd = '0' |
| | | left join r_repair_user ru on t.repair_id = ru.repair_id and t.status_cd = 0 |
| | | where 1 =1 |
| | | and ru.state in ('10002','10003','10004','10005') |
| | | and ru.staff_id = #{staffId} |
| | | and ru.state in ('10002','10003','10004','10005','10009','11000','12000') |
| | | <if test="staffId != null and staffId != ''"> |
| | | and ru.staff_id = #{staffId} |
| | | </if> |
| | | <if test="repairName !=null and repairName != ''"> |
| | | and t.repair_name= #{repairName} |
| | | </if> |
| | |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | <if test="repairObjType !=null and repairObjType != ''"> |
| | | and t.repair_obj_type= #{repairObjType} |
| | | </if> |
| | |
| | | <if test="context !=null and context != ''"> |
| | | , t.context= #{context} |
| | | </if> |
| | | |
| | | <if test="state !=null and state != ''"> |
| | | , t.state= #{state} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | |
| | | <if test="end_time !=null "> |
| | | , t.end_time= #{end_time} |
| | | <if test="endTime !=null "> |
| | | , t.end_time= #{endTime} |
| | | </if> |
| | | |
| | | <if test="startTime !=null "> |
| | | , t.start_time= #{startTime} |
| | | </if> |
| | | where 1=1 |
| | | <if test="ruId !=null and ruId != ''"> |
| | | and t.ru_id= #{ruId} |
| | |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <!-- <if test="state !=null and state != ''">--> |
| | | <!-- and t.state= #{state}--> |
| | | <!-- </if>--> |
| | | <!--<if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if>--> |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and t.staff_id= #{staffId} |
| | | </if> |
| | | <if test="repairId !=null and repairId != ''"> |
| | | and t.repair_id= #{repairId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询报修派单数量 add by wuxw 2018-07-03 --> |
| | |
| | | <if test="preRuId !=null and preRuId != ''"> |
| | | and t.pre_ru_id= #{preRuId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="resourceStoreServiceDaoImpl"> |
| | | |
| | | <!-- 查询资源物品信息 --> |
| | | <select id="getResourceStoresInfo" parameterType="Map" resultType="Map"> |
| | | select t.res_id resId,t.store_id storeId,t.res_name resName,t.res_code resCode,t.goods_type goodsType, |
| | | t.unit_code unitCode,t.remark,t.out_low_price outLowPrice,t.out_high_price outHighPrice, |
| | | t.show_mobile showMobile,t.description,t.price,t.stock,t.create_time createTime |
| | | from resource_store t |
| | | where 1 = 1 |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="resName !=null and resName != ''"> |
| | | and t.res_name= #{resName} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | and t.res_code= #{resCode} |
| | | </if> |
| | | <if test="goodsType !=null and goodsType != ''"> |
| | | and t.goods_type= #{goodsType} |
| | | </if> |
| | | <if test="unitCode !=null and unitCode != ''"> |
| | | and t.unit_code= #{unitCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="outLowPrice !=null and outLowPrice != ''"> |
| | | and t.out_low_price= #{outLowPrice} |
| | | </if> |
| | | <if test="outHighPrice !=null and outHighPrice != ''"> |
| | | and t.out_high_price= #{outHighPrice} |
| | | </if> |
| | | <if test="showMobile !=null and showMobile != ''"> |
| | | and t.show_mobile= #{showMobile} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="price !=null and price != ''"> |
| | | and t.price= #{price} |
| | | </if> |
| | | <if test="stock !=null and stock != ''"> |
| | | and t.stock= #{stock} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询资源物品数量 --> |
| | | <select id="getResourceStoresCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from resource_store t |
| | | where 1 =1 |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="resName !=null and resName != ''"> |
| | | and t.res_name= #{resName} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | and t.res_code= #{resCode} |
| | | </if> |
| | | <if test="goodsType !=null and goodsType != ''"> |
| | | and t.goods_type= #{goodsType} |
| | | </if> |
| | | <if test="unitCode !=null and unitCode != ''"> |
| | | and t.unit_code= #{unitCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="outLowPrice !=null and outLowPrice != ''"> |
| | | and t.out_low_price= #{outLowPrice} |
| | | </if> |
| | | <if test="outHighPrice !=null and outHighPrice != ''"> |
| | | and t.out_high_price= #{outHighPrice} |
| | | </if> |
| | | <if test="showMobile !=null and showMobile != ''"> |
| | | and t.show_mobile= #{showMobile} |
| | | </if> |
| | | <if test="description !=null and description != ''"> |
| | | and t.description= #{description} |
| | | </if> |
| | | <if test="price !=null and price != ''"> |
| | | and t.price= #{price} |
| | | </if> |
| | | <if test="stock !=null and stock != ''"> |
| | | and t.stock= #{stock} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <!-- 保存资源信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessResourceStoreInfo" parameterType="Map"> |
| | | insert into business_resource_store( |
| | | res_name,operate,price,res_code,description,store_id,stock,b_id,res_id |
| | | res_name,operate,price,res_code,description,store_id,stock,b_id,res_id,goods_type, |
| | | unit_code,remark,out_low_price,out_high_price,show_mobile,create_time |
| | | ) values ( |
| | | #{resName},#{operate},#{price},#{resCode},#{description},#{storeId},#{stock},#{bId},#{resId} |
| | | #{resName},#{operate},#{price},#{resCode},#{description},#{storeId},#{stock},#{bId},#{resId}, |
| | | #{goodsType},#{unitCode},#{remark},#{outLowPrice},#{outHighPrice},#{showMobile},#{createTime} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询资源信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessResourceStoreInfo" parameterType="Map" resultType="Map"> |
| | | select t.res_name,t.res_name resName,t.operate,t.price,t.res_code,t.res_code |
| | | resCode,t.description,t.store_id,t.store_id storeId,t.stock,t.b_id,t.b_id bId,t.res_id,t.res_id resId |
| | | resCode,t.description,t.store_id,t.store_id storeId,t.stock,t.b_id,t.b_id bId,t.res_id,t.res_id resId, |
| | | t.goods_type,t.goods_type goodsType,t.unit_code,t.unit_code unitCode,t.remark, |
| | | t.out_low_price,t.out_low_price outLowPrice,t.out_high_price,t.out_high_price outHighPrice, |
| | | t.show_mobile,t.show_mobile showMobile,t.create_time,t.create_time createTime |
| | | from business_resource_store t |
| | | where 1 =1 |
| | | <if test="resName !=null and resName != ''"> |
| | |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | |
| | | <if test="goodsType !=null and goodsType != ''"> |
| | | and t.goods_type= #{goodsType} |
| | | </if> |
| | | <if test="unitCode !=null and unitCode != ''"> |
| | | and t.unit_code= #{unitCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="outLowPrice !=null and outLowPrice != ''"> |
| | | and t.out_low_price= #{outLowPrice} |
| | | </if> |
| | | <if test="outHighPrice !=null and outHighPrice != ''"> |
| | | and t.out_high_price= #{outHighPrice} |
| | | </if> |
| | | <if test="showMobile !=null and showMobile != ''"> |
| | | and t.show_mobile= #{showMobile} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <!-- 保存资源信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveResourceStoreInfoInstance" parameterType="Map"> |
| | | insert into resource_store( |
| | | res_name,price,res_code,description,status_cd,store_id,stock,b_id,res_id |
| | | ) select t.res_name,t.price,t.res_code,t.description,'0',t.store_id,t.stock,t.b_id,t.res_id from |
| | | res_name,price,res_code,description,status_cd,store_id,stock,b_id,res_id,goods_type,unit_code,remark, |
| | | out_low_price,out_high_price,show_mobile,create_time |
| | | ) select t.res_name,t.price,t.res_code,t.description,'0',t.store_id,t.stock,t.b_id,t.res_id,t.goods_type, |
| | | t.unit_code,t.remark,t.out_low_price,t.out_high_price,t.show_mobile,t.create_time from |
| | | business_resource_store t where 1=1 |
| | | <if test="resName !=null and resName != ''"> |
| | | and t.res_name= #{resName} |
| | |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | |
| | | <if test="goodsType !=null and goodsType != ''"> |
| | | and t.goods_type= #{goodsType} |
| | | </if> |
| | | <if test="unitCode !=null and unitCode != ''"> |
| | | and t.unit_code= #{unitCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="outLowPrice !=null and outLowPrice != ''"> |
| | | and t.out_low_price= #{outLowPrice} |
| | | </if> |
| | | <if test="outHighPrice !=null and outHighPrice != ''"> |
| | | and t.out_high_price= #{outHighPrice} |
| | | </if> |
| | | <if test="showMobile !=null and showMobile != ''"> |
| | | and t.show_mobile= #{showMobile} |
| | | </if> |
| | | <if test="createTime !=null and createTime != ''"> |
| | | and t.create_time= #{createTime} |
| | | </if> |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询资源信息 add by wuxw 2018-07-03 --> |
| | | <select id="getResourceStoreInfo" parameterType="Map" resultType="Map"> |
| | | select t.res_name,t.res_name resName,t.price,t.res_code,t.res_code resCode,t.description,t.status_cd,t.status_cd |
| | | statusCd,t.store_id,t.store_id storeId,t.stock,t.b_id,t.b_id bId,t.res_id,t.res_id resId |
| | | statusCd,t.store_id,t.store_id storeId,t.stock,t.b_id,t.b_id bId,t.res_id,t.res_id resId,t.out_low_price, |
| | | t.out_low_price outLowPrice,td.name goodsTypeName,t.out_high_price,t.out_high_price outHighPrice,t.goods_type, |
| | | t.goods_type goodsType,t.unit_code,t.unit_code unitCode,t.remark,t.show_mobile,t.show_mobile showMobile, |
| | | t.create_time,t.create_time createTime |
| | | from resource_store t |
| | | left join t_dict td on t.goods_type = td.status_cd |
| | | and td.table_name = 'resource_store' and td.table_columns ='goods_type' |
| | | where 1 =1 |
| | | <if test="resName !=null and resName != ''"> |
| | | and t.res_name like concat('%',#{resName},'%') |
| | | </if> |
| | | <if test="price !=null and price != ''"> |
| | | and t.price= #{price} |
| | | </if> |
| | | <if test="outLowPrice !=null and outLowPrice != ''"> |
| | | and t.out_low_price = #{outLowPrice} |
| | | </if> |
| | | <if test="outHighPrice != null and outHighPrice != ''"> |
| | | and t.out_high_price = #{outHighPrice} |
| | | </if> |
| | | <if test="goodsType != null and goodsType != ''"> |
| | | and t.goods_type = #{goodsType} |
| | | </if> |
| | | <if test="unitCode != null and unitCode != ''"> |
| | | and t.unit_code = #{unitCode} |
| | | </if> |
| | | <if test="remark != null and remark != ''"> |
| | | and t.remark = #{remark} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | and t.res_code= #{resCode} |
| | |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | <if test="showMobile != null and showMobile != ''"> |
| | | and t.show_mobile = #{showMobile} |
| | | </if> |
| | | <if test="resOrderType == '20000'"> |
| | | and t.stock > 0 |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 修改资源信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateResourceStoreInfoInstance" parameterType="Map"> |
| | |
| | | </if> |
| | | <if test="price !=null and price != ''"> |
| | | , t.price= #{price} |
| | | </if> |
| | | <if test="outLowPrice !=null and outLowPrice != ''"> |
| | | , t.out_low_price= #{outLowPrice} |
| | | </if> |
| | | <if test="outHighPrice !=null and outHighPrice != ''"> |
| | | , t.out_high_price= #{outHighPrice} |
| | | </if> |
| | | <if test="goodsType !=null and goodsType != ''"> |
| | | , t.goods_type= #{goodsType} |
| | | </if> |
| | | <if test="unitCode !=null and unitCode != ''"> |
| | | , t.unit_code= #{unitCode} |
| | | </if> |
| | | <if test="showMobile !=null and showMobile != ''"> |
| | | , t.show_mobile= #{showMobile} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | , t.remark= #{remark} |
| | | </if> |
| | | <if test="resCode !=null and resCode != ''"> |
| | | , t.res_code= #{resCode} |
| | |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询资源数量 add by wuxw 2018-07-03 --> |
| | |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | <if test="goodsType !=null and goodsType != ''"> |
| | | and t.goods_type= #{goodsType} |
| | | </if> |
| | | <if test="unitCode !=null and unitCode != ''"> |
| | | and t.unit_code= #{unitCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="outLowPrice !=null and outLowPrice != ''"> |
| | | and t.out_low_price= #{outLowPrice} |
| | | </if> |
| | | <if test="outHighPrice !=null and outHighPrice != ''"> |
| | | and t.out_high_price= #{outHighPrice} |
| | | </if> |
| | | <if test="showMobile !=null and showMobile != ''"> |
| | | and t.show_mobile= #{showMobile} |
| | | </if> |
| | | <if test="resOrderType == '20000'"> |
| | | and t.stock > 0 |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <select id="getUsers" parameterType="Map" resultType="Map"> |
| | | select u.user_id, u.user_id userId,u.name,u.name |
| | | userName,u.email,u.address,u.password,u.location_cd,u.location_cd locationCd, |
| | | u.age,u.sex,u.tel,u.level_cd,u.b_id |
| | | u.age,u.sex,u.tel,u.level_cd,u.b_id,u.level_cd levelCd |
| | | from u_user u |
| | | <if test="openId != null and openId !=''"> |
| | | ,u_user_attr ua |
| | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param repairDto 数据对象分享 |
| | | * @return RepairDto 对象数据 |
| | | */ |
| | |
| | | @RequestMapping(value = "/queryRepairsCount", method = RequestMethod.POST) |
| | | int queryRepairsCount(@RequestBody RepairDto repairDto); |
| | | |
| | | |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param repairDto 数据对象分享 |
| | | * @return RepairDto 对象数据 |
| | |
| | | @RequestMapping(value = "/queryStaffRepairsCount", method = RequestMethod.POST) |
| | | int queryStaffRepairsCount(@RequestBody RepairDto repairDto); |
| | | |
| | | |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param repairDto 数据对象分享 |
| | | * @return RepairDto 对象数据 |
| | |
| | | |
| | | @RequestMapping(value = "/updateRepair", method = RequestMethod.POST) |
| | | int updateRepair(@RequestBody RepairPoolPo repairPoolPo); |
| | | |
| | | } |
| | |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.po.owner.RepairUserPo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param repairUserDto 数据对象分享 |
| | | * @return RepairUserDto 对象数据 |
| | | */ |
| | |
| | | */ |
| | | @RequestMapping(value = "/queryRepairUsersCount", method = RequestMethod.POST) |
| | | int queryRepairUsersCount(@RequestBody RepairUserDto repairUserDto); |
| | | |
| | | /** |
| | | * 保存报修派单信息 |
| | | * |
| | | * @param repairUserPo |
| | | */ |
| | | @RequestMapping(value = "/saveRepairUser", method = RequestMethod.POST) |
| | | void saveRepairUser(@RequestBody RepairUserPo repairUserPo); |
| | | } |
| New file |
| | |
| | | package com.java110.intf.community; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.po.purchase.ResourceStorePo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(name = "community-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/resourceStoreApi") |
| | | public interface IResourceStoreServiceSMO { |
| | | |
| | | /** |
| | | * 查询资源物品信息 |
| | | * |
| | | * @param resourceStorePo |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getResourceStores", method = RequestMethod.POST) |
| | | List<ResourceStorePo> getResourceStores(@RequestBody ResourceStorePo resourceStorePo); |
| | | |
| | | /** |
| | | * 查询资源物品信息数量 |
| | | * |
| | | * @param resourceStorePo |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getResourceStoresCount", method = RequestMethod.POST) |
| | | int getResourceStoresCount(@RequestBody ResourceStorePo resourceStorePo); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 保修派单信息 |
| | | * 报修派单信息 |
| | | * 11开头 3保存 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_REPAIR_USER="130200030001"; |
| | | /** |
| | | * 保修派单变更 11开头 4修改 |
| | | * 报修派单变更 11开头 4修改 |
| | | */ |
| | | public static final String BUSINESS_TYPE_UPDATE_REPAIR_USER="130200040001"; |
| | | /** |
| | | * 作废保修派单信息 11开头 5修改 |
| | | * 作废报修派单信息 11开头 5修改 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_REPAIR_USER ="130200050001"; |
| | | |
| | |
| | | * @author wux |
| | | * @create 2019-02-05 下午11:28 |
| | | * @desc 业务类型 |
| | | * |
| | | * <p> |
| | | * 用户为1001 开头 |
| | | * 商户为2001 开头 |
| | | * 商品为3001 开头 |
| | |
| | | public static final String FEE_TYPE_CAR = "888800010008"; |
| | | |
| | | /** |
| | | * 保修费费 |
| | | * 维修费 |
| | | */ |
| | | public static final String FEE_TYPE_REPAIR = "888800010012"; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * 停车费 地上 临时车费用 |
| | | */ |
| | | // public static final String FEE_TYPE_TEMP_UP_PARKING_SPACE = "888800010008"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public static final String BINDING_APPRAISE_REPAIR = "ownerRepair.appraiseRepair"; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 新增数据方法 |
| | | * |
| | | * { |
| | | * HTTP_BUSINESS_TYPE_CD:''. |
| | | * HTTP_SEQ:1, |
| | | * HTTP_INVOKE_MODEL:'s', |
| | | * data:[{ |
| | | * ps:Id |
| | | * xxxxx |
| | | * xxxx |
| | | * |
| | | * }] |
| | | * } |
| | | * |
| | | * @param context 上下文对象 |
| | | * @param param po对象 |
| | | */ |
| | |
| | | import com.java110.api.bmo.ApiBaseBMO; |
| | | import com.java110.api.bmo.resourceStore.IResourceStoreBMO; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.intf.common.IFileInnerServiceSMO; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.store.IResourceStoreInnerServiceSMO; |
| | | import com.java110.dto.resourceStore.ResourceStoreDto; |
| | | import com.java110.po.file.FileRelPo; |
| | | import com.java110.po.purchase.ResourceStorePo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private IResourceStoreInnerServiceSMO resourceStoreInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileInnerServiceSMO fileInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * 删除资源信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void deleteResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | paramInJson.put("statusCd", "1"); |
| | | ResourceStorePo resourceStorePo = BeanConvertUtil.covertBean(paramInJson, ResourceStorePo.class); |
| | | super.delete(dataFlowContext, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_RESOURCE_STORE); |
| | | //获取资源id |
| | | String resId = paramInJson.getString("resId"); |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(resId); |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | if (fileRelDtos != null && fileRelDtos.size() > 0) { |
| | | //删除文件表图片 |
| | | for (FileRelDto fileRel : fileRelDtos) { |
| | | FileRelPo fileRelpo = new FileRelPo(); |
| | | fileRelpo.setFileRelId(fileRel.getFileRelId()); |
| | | super.delete(dataFlowContext, fileRelpo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_FILE_REL); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void addResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | JSONObject businessResourceStore = new JSONObject(); |
| | | businessResourceStore.putAll(paramInJson); |
| | | businessResourceStore.put("resId", "-1"); |
| | | businessResourceStore.put("resId", GenerateCodeFactory.getResId(GenerateCodeFactory.CODE_PREFIX_resId)); |
| | | businessResourceStore.put("stock", "0"); |
| | | businessResourceStore.put("createTime", new Date()); |
| | | ResourceStorePo resourceStorePo = BeanConvertUtil.covertBean(businessResourceStore, ResourceStorePo.class); |
| | | super.insert(dataFlowContext, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_RESOURCE_STORE); |
| | | //将图片插入文件表里 |
| | | FileRelPo fileRelPo = new FileRelPo(); |
| | | fileRelPo.setObjId(resourceStorePo.getResId()); |
| | | //table表示表存储 ftp表示ftp文件存储 |
| | | fileRelPo.setSaveWay("ftp"); |
| | | fileRelPo.setCreateTime(new Date()); |
| | | //图片 |
| | | List<String> photos = resourceStorePo.getPhotos(); |
| | | if (photos != null && photos.size() > 0) { |
| | | //22000表示物品图片 |
| | | fileRelPo.setRelTypeCd("22000"); |
| | | for (String photo : photos) { |
| | | fileRelPo.setFileRelId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_relId)); |
| | | FileDto fileDto = new FileDto(); |
| | | fileDto.setCommunityId("-1"); |
| | | fileDto.setContext(photo); |
| | | fileDto.setFileId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_file_id)); |
| | | fileDto.setFileName(fileDto.getFileId()); |
| | | String fileName = fileInnerServiceSMOImpl.saveFile(fileDto); |
| | | fileRelPo.setFileRealName(fileName); |
| | | fileRelPo.setFileSaveName(fileName); |
| | | super.insert(dataFlowContext, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void updateResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | ResourceStoreDto resourceStoreDto = new ResourceStoreDto(); |
| | | resourceStoreDto.setResId(paramInJson.getString("resId")); |
| | | resourceStoreDto.setStoreId(paramInJson.getString("storeId")); |
| | | |
| | | List<ResourceStoreDto> resourceStoreDtos = resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto); |
| | | |
| | | Assert.isOne(resourceStoreDtos, "查询到多条物品 或未查到物品,resId=" + resourceStoreDto.getResId()); |
| | | |
| | | JSONObject businessResourceStore = new JSONObject(); |
| | | businessResourceStore.putAll(paramInJson); |
| | | businessResourceStore.put("stock", resourceStoreDtos.get(0).getStock()); |
| | | ResourceStorePo resourceStorePo = BeanConvertUtil.covertBean(businessResourceStore, ResourceStorePo.class); |
| | | super.update(dataFlowContext, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_RESOURCE_STORE); |
| | | //获取图片信息 |
| | | List<String> photos = resourceStorePo.getFileUrls(); |
| | | //图片更新 |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(paramInJson.getString("resId")); |
| | | //查询文件表 |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | //如果文件表里有这个资源的记录,就先删掉原先的 |
| | | if (fileRelDtos != null && fileRelDtos.size() > 0) { |
| | | //先把删除文件表图片 |
| | | for (FileRelDto fileRel : fileRelDtos) { |
| | | FileRelPo fileRelPo = new FileRelPo(); |
| | | fileRelPo.setFileRelId(fileRel.getFileRelId()); |
| | | super.delete(dataFlowContext, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_FILE_REL); |
| | | } |
| | | FileRelPo fileRel = new FileRelPo(); |
| | | fileRel.setObjId(resourceStorePo.getResId()); |
| | | //table表示表存储 ftp表示ftp文件存储 |
| | | fileRel.setSaveWay("ftp"); |
| | | fileRel.setCreateTime(new Date()); |
| | | if (photos != null && photos.size() > 0) { |
| | | //22000表示物品图片 |
| | | fileRel.setRelTypeCd("22000"); |
| | | for (String photo : photos) { |
| | | fileRel.setFileRelId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_relId)); |
| | | FileDto fileDto = new FileDto(); |
| | | fileDto.setCommunityId("-1"); |
| | | fileDto.setContext(photo); |
| | | fileDto.setFileId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_file_id)); |
| | | fileDto.setFileName(fileDto.getFileId()); |
| | | String fileName = fileInnerServiceSMOImpl.saveFile(fileDto); |
| | | fileRel.setFileRealName(fileName); |
| | | fileRel.setFileSaveName(fileName); |
| | | /*fileRelInnerServiceSMOImpl.saveFileRel(fileRel);*/ |
| | | super.insert(dataFlowContext, fileRel, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | } |
| | | } |
| | | } else if (photos != null && photos.size() > 0) { //如果文件表里没有这个资源的记录,就判断是否有图片传过来,有就插入到文件表里 |
| | | FileRelPo fileRel = new FileRelPo(); |
| | | fileRel.setObjId(resourceStorePo.getResId()); |
| | | //table表示表存储 ftp表示ftp文件存储 |
| | | fileRel.setSaveWay("ftp"); |
| | | fileRel.setCreateTime(new Date()); |
| | | //22000表示物品图片 |
| | | fileRel.setRelTypeCd("22000"); |
| | | for (String photo : photos) { |
| | | fileRel.setFileRelId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_relId)); |
| | | FileDto fileDto = new FileDto(); |
| | | fileDto.setCommunityId("-1"); |
| | | fileDto.setContext(photo); |
| | | fileDto.setFileId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_file_id)); |
| | | fileDto.setFileName(fileDto.getFileId()); |
| | | String fileName = fileInnerServiceSMOImpl.saveFile(fileDto); |
| | | fileRel.setFileRealName(fileName); |
| | | fileRel.setFileSaveName(fileName); |
| | | super.insert(dataFlowContext, fileRel, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | computeFeePrice(feeDtos); |
| | | fees = BeanConvertUtil.covertBeanList(feeDtos, ApiFeeDataVo.class); |
| | | freshFeeAttrs(fees, feeDtos); |
| | | |
| | | |
| | | } else { |
| | | fees = new ArrayList<>(); |
| | | } |
| | | |
| | | ApiFeeVo apiFeeVo = new ApiFeeVo(); |
| | | |
| | | apiFeeVo.setTotal(count); |
| | | apiFeeVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiFeeVo.setFees(fees); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiFeeVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | |
| | | private void freshFeeAttrs(List<ApiFeeDataVo> fees, List<FeeDto> feeDtos) { |
| | | |
| | | for (ApiFeeDataVo apiFeeDataVo : fees) { |
| | | for (FeeDto feeDto : feeDtos) { |
| | | if (apiFeeDataVo.getFeeId().equals(feeDto.getFeeId())) { |
| | |
| | | } |
| | | |
| | | private void computeFeePrice(List<FeeDto> feeDtos) { |
| | | |
| | | for (FeeDto feeDto : feeDtos) { |
| | | try { |
| | | // 轮数 * 周期 * 30 + 开始时间 = 目标 到期时间 |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private void computeFeePriceByCar(FeeDto feeDto, double oweMonth) { |
| | | OwnerCarDto ownerCarDto = new OwnerCarDto(); |
| | |
| | | feeDto.setDeadlineTime(DateUtil.getCurrentDate()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.java110.dto.feeReceipt.FeeReceiptDetailDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.intf.community.IParkingSpaceInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.intf.community.IRoomInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeAttrInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeConfigInnerServiceSMO; |
| | |
| | | import com.java110.po.feeReceipt.FeeReceiptPo; |
| | | import com.java110.po.feeReceiptDetail.FeeReceiptDetailPo; |
| | | import com.java110.po.owner.RepairPoolPo; |
| | | import com.java110.po.owner.RepairUserPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | |
| | | private IFeeBMO feeBMOImpl; |
| | | |
| | | @Autowired |
| | | private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; |
| | | @Autowired |
| | | private IFeeInnerServiceSMO feeInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private IFeeReceiptDetailInnerServiceSMO feeReceiptDetailInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRepairUserInnerServiceSMO repairUserInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMO; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | |
| | | feeAttrDto.setFeeId(paramObj.getString("feeId")); |
| | | feeAttrDto.setSpecCd(FeeAttrDto.SPEC_CD_REPAIR); |
| | | List<FeeAttrDto> feeAttrDtos = feeAttrInnerServiceSMOImpl.queryFeeAttrs(feeAttrDto); |
| | | |
| | | //修改 派单状态 |
| | | if (feeAttrDtos != null && feeAttrDtos.size() > 0) { |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 2); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | RepairDto repairDto = new RepairDto(); |
| | | repairDto.setRepairId(feeAttrDtos.get(0).getValue()); |
| | | //查询报修记录 |
| | | List<RepairDto> repairDtos = repairInnerServiceSMO.queryRepairs(repairDto); |
| | | Assert.listOnlyOne(repairDtos, "报修信息错误!"); |
| | | //获取报修渠道 |
| | | String repairChannel = repairDtos.get(0).getRepairChannel(); |
| | | RepairPoolPo repairPoolPo = new RepairPoolPo(); |
| | | repairPoolPo.setRepairId(feeAttrDtos.get(0).getValue()); |
| | | repairPoolPo.setCommunityId(paramObj.getString("communityId")); |
| | | repairPoolPo.setState(RepairDto.STATE_APPRAISE); |
| | | if (repairChannel.equals("Z")) { //如果是业主自主报修,状态就变成待评价 |
| | | repairPoolPo.setState(RepairDto.STATE_APPRAISE); |
| | | } else { //如果是员工代客报修或电话报修,状态就变成待回访 |
| | | repairPoolPo.setState(RepairDto.STATE_RETURN_VISIT); |
| | | } |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(RepairPoolPo.class.getSimpleName(), BeanConvertUtil.beanCovertMap(repairPoolPo)); |
| | | businesses.add(business); |
| | | } |
| | | |
| | | //修改报修派单状态 |
| | | if (feeAttrDtos != null && feeAttrDtos.size() > 0) { |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_USER); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 3); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | RepairDto repairDto = new RepairDto(); |
| | | repairDto.setRepairId(feeAttrDtos.get(0).getValue()); |
| | | //查询报修记录 |
| | | List<RepairDto> repairDtos = repairInnerServiceSMO.queryRepairs(repairDto); |
| | | Assert.listOnlyOne(repairDtos, "报修信息错误!"); |
| | | //获取报修渠道 |
| | | String repairChannel = repairDtos.get(0).getRepairChannel(); |
| | | RepairUserDto repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairId(feeAttrDtos.get(0).getValue()); |
| | | repairUserDto.setState(RepairUserDto.STATE_PAY_FEE); |
| | | //查询待支付状态的记录 |
| | | List<RepairUserDto> repairUserDtoList = repairUserInnerServiceSMO.queryRepairUsers(repairUserDto); |
| | | Assert.listOnlyOne(repairUserDtoList, "信息错误!"); |
| | | RepairUserPo repairUserPo = new RepairUserPo(); |
| | | repairUserPo.setRuId(repairUserDtoList.get(0).getRuId()); |
| | | if (repairChannel.equals("Z")) { //如果业主是自主报修,状态就变成待评价 |
| | | repairUserPo.setState(RepairUserDto.STATE_EVALUATE); |
| | | //如果是待评价状态,就更新开始时间 |
| | | repairUserPo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | repairUserPo.setContext("待评价"); |
| | | } else { //如果是员工代客报修或电话报修,状态就变成已支付 |
| | | repairUserPo.setState(RepairUserDto.STATE_FINISH_PAY_FEE); |
| | | //如果是已支付状态,就更新结束时间 |
| | | repairUserPo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | repairUserPo.setContext("已支付"); |
| | | } |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put(RepairUserPo.class.getSimpleName(), BeanConvertUtil.beanCovertMap(repairUserPo)); |
| | | businesses.add(business); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = feeBMOImpl.callService(dataFlowContext, service.getServiceCode(), businesses); |
| | | dataFlowContext.setResponseEntity(responseEntity); |
| | | |
| | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeConfigInnerServiceSMO; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.po.owner.RepairUserPo; |
| | |
| | | import com.java110.utils.constant.ServiceCodeRepairDispatchStepConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Java110Listener("appraiseRepairListener") |
| | | public class AppraiseRepairListener extends AbstractServiceApiPlusListener { |
| | | |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(AppraiseRepairListener.class); |
| | | |
| | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息"); |
| | | Assert.hasKeyAndValue(reqJson, "context", "未包含派单内容"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息"); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | String userId = reqJson.getString("userId"); |
| | | String userName = reqJson.getString("userName"); |
| | | |
| | | //获取报修渠道 |
| | | String repairChannel = reqJson.getString("repairChannel"); |
| | | //是否是公共区域 |
| | | String publicArea = reqJson.getString("publicArea"); |
| | | //查询维修类型 |
| | | String maintenanceType = reqJson.getString("maintenanceType"); |
| | | RepairUserDto repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairId(reqJson.getString("repairId")); |
| | | repairUserDto.setCommunityId(reqJson.getString("communityId")); |
| | | repairUserDto.setState(RepairUserDto.STATE_DOING); |
| | | repairUserDto.setStaffId(userId); |
| | | if (repairChannel.equals("Z")) { //如果是业主端报修,就查询是否有已评价状态的 |
| | | repairUserDto.setState(RepairUserDto.STATE_FINISH); |
| | | } else if (!StringUtil.isEmpty(maintenanceType) && maintenanceType.equals("1001")) { //如果不是业主端报修,且是有偿的,就查询已支付状态的 |
| | | repairUserDto.setState(RepairUserDto.STATE_FINISH_PAY_FEE); |
| | | } else { //其他的查询结单状态的 |
| | | repairUserDto.setState(RepairUserDto.STATE_CLOSE); |
| | | } |
| | | List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); |
| | | Assert.listOnlyOne(repairUserDtos, "当前用户没有需要处理订单"); |
| | | Assert.listOnlyOne(repairUserDtos, "当前用户没有需要处理的订单"); |
| | | // 1.0 关闭自己订单 |
| | | RepairUserPo repairUserPo = new RepairUserPo(); |
| | | repairUserPo.setRuId(repairUserDtos.get(0).getRuId()); |
| | | repairUserPo.setRuId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ruId)); |
| | | repairUserPo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | repairUserPo.setState(RepairUserDto.STATE_CLOSE); |
| | | repairUserPo.setState(RepairUserDto.STATE_FINISH_VISIT); |
| | | repairUserPo.setContext(reqJson.getString("context")); |
| | | repairUserPo.setCommunityId(reqJson.getString("communityId")); |
| | | super.update(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_USER); |
| | | |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_RETURN_VISIT); |
| | | |
| | | |
| | | repairUserPo.setCreateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | repairUserPo.setRepairId(reqJson.getString("repairId")); |
| | | repairUserPo.setStaffId(reqJson.getString("userId")); |
| | | repairUserPo.setStaffName(reqJson.getString("userName")); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date endTime = repairUserDtos.get(0).getEndTime(); |
| | | repairUserPo.setStartTime(format.format(endTime)); |
| | | repairUserPo.setPreStaffId(repairUserDtos.get(0).getStaffId()); |
| | | repairUserPo.setPreStaffName(repairUserDtos.get(0).getStaffName()); |
| | | repairUserPo.setPreRuId(repairUserDtos.get(0).getRuId()); |
| | | repairUserPo.setRepairEvent("auditUser"); |
| | | super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER); |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_COMPLATE); |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_OK, ResultVo.MSG_OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | ownerRepairDto.setRoomIds(roomIds); |
| | | ownerRepairDto.setRoomId(""); |
| | | } |
| | | //PC电话报修、PC工单池、H5工单池 |
| | | //手机端员工单工单池 只返回未处理状态的数据 |
| | | if (!StringUtil.isEmpty(ownerRepairDto.getReqSource()) && ownerRepairDto.getReqSource().equals("mobile")) { |
| | | ownerRepairDto.setState(RepairDto.STATE_WAIT); |
| | | } |
| | | //pc电话报修模块 只返回PC员工登记和手机端员工登记的数据 |
| | | if (!StringUtil.isEmpty(ownerRepairDto.getReqSource()) && ownerRepairDto.getReqSource().equals("pc_mobile")) { |
| | | String[] repair_channel={RepairDto.REPAIR_CHANNEL_STAFF, RepairDto.REPAIR_CHANNEL_TEL}; |
| | | ownerRepairDto.setRepairChannels(Arrays.asList(repair_channel)); |
| | | } |
| | | |
| | | |
| | | int count = repairInnerServiceSMOImpl.queryRepairsCount(ownerRepairDto); |
| | | |
| | |
| | | photoVo.setUrl("/callComponent/download/getFile/file?fileId=" + tmpFileRelDto.getFileRealName() + "&communityId=" + repairDto.getCommunityId()); |
| | | photoVo.setRelTypeCd(tmpFileRelDto.getRelTypeCd()); |
| | | photoVos.add(photoVo); |
| | | if (tmpFileRelDto.getRelTypeCd().equals("14000")) { //维修图片 |
| | | if (tmpFileRelDto.getRelTypeCd().equals(FileRelDto.REL_TYPE_CD_REPAIR)) { //维修图片 |
| | | photoVo = new PhotoVo(); |
| | | photoVo.setUrl("/callComponent/download/getFile/file?fileId=" + tmpFileRelDto.getFileRealName() + "&communityId=" + repairDto.getCommunityId()); |
| | | photoVo.setRelTypeCd(tmpFileRelDto.getRelTypeCd()); |
| | | repairPhotos.add(photoVo); //维修图片 |
| | | } else if (tmpFileRelDto.getRelTypeCd().equals("19000")) { //维修前图片 |
| | | } else if (tmpFileRelDto.getRelTypeCd().equals(FileRelDto.BEFORE_REPAIR_PHOTOS)) { //维修前图片 |
| | | photoVo = new PhotoVo(); |
| | | photoVo.setUrl("/callComponent/download/getFile/file?fileId=" + tmpFileRelDto.getFileRealName() + "&communityId=" + repairDto.getCommunityId()); |
| | | photoVo.setRelTypeCd(tmpFileRelDto.getRelTypeCd()); |
| | | beforePhotos.add(photoVo); //维修前图片 |
| | | } else if (tmpFileRelDto.getRelTypeCd().equals("200000")) { //维修后图片 |
| | | } else if (tmpFileRelDto.getRelTypeCd().equals(FileRelDto.AFTER_REPAIR_PHOTOS)) { //维修后图片 |
| | | photoVo = new PhotoVo(); |
| | | photoVo.setUrl("/callComponent/download/getFile/file?fileId=" + tmpFileRelDto.getFileRealName() + "&communityId=" + repairDto.getCommunityId()); |
| | | photoVo.setRelTypeCd(tmpFileRelDto.getRelTypeCd()); |
| | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.utils.constant.ServiceCodeOwnerRepairConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Autowired |
| | | private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMO; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IRepairInnerServiceSMO getRepairInnerServiceSMOImpl() { |
| | | return repairInnerServiceSMOImpl; |
| | |
| | | super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求中未包含小区ID"); |
| | | Assert.hasKeyAndValue(reqJson, "userId", "请求中未包含员工信息"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | RepairDto ownerRepairDto = BeanConvertUtil.covertBean(reqJson, RepairDto.class); |
| | | ownerRepairDto.setStaffId(reqJson.getString("userId")); |
| | | |
| | | if(reqJson.containsKey("repairStates")){ |
| | | String userId = reqJson.getString("userId"); |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | //查询用户信息 |
| | | List<UserDto> users = userInnerServiceSMO.getUsers(userDto); |
| | | Assert.listOnlyOne(users, "数据异常未找到用户信息"); |
| | | if (!users.get(0).getLevelCd().equals("00")) { //当前用户不是管理员时放入staffId的值 |
| | | ownerRepairDto.setStaffId(reqJson.getString("userId")); |
| | | } |
| | | if (reqJson.containsKey("repairStates")) { |
| | | String[] states = reqJson.getString("repairStates").split(","); |
| | | ownerRepairDto.setStates(Arrays.asList(states)); |
| | | }else{ |
| | | //Pc WEB维修已办 |
| | | String[] states={RepairDto.STATE_BACK, RepairDto.STATE_TRANSFER, RepairDto.STATE_PAY_ERROR, RepairDto.STATE_APPRAISE, RepairDto.STATE_RETURN_VISIT, RepairDto.STATE_COMPLATE}; |
| | | ownerRepairDto.setStates(Arrays.asList(states)); |
| | | } |
| | | |
| | | int count = repairInnerServiceSMOImpl.queryStaffFinishRepairsCount(ownerRepairDto); |
| | | |
| | | |
| | | List<RepairDto> ownerRepairs = null; |
| | | if (count > 0) { |
| | | ownerRepairs = repairInnerServiceSMOImpl.queryStaffFinishRepairs(ownerRepairDto); |
| | | |
| | | //refreshStaffName(ownerRepairs); |
| | | } else { |
| | | ownerRepairs = new ArrayList<>(); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, ownerRepairs); |
| | | |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | |
| | | private void refreshStaffName(List<RepairDto> ownerRepairs) { |
| | | |
| | | List<String> repairIds = new ArrayList<>(); |
| | | for (RepairDto apiOwnerRepairDataVo : ownerRepairs) { |
| | | repairIds.add(apiOwnerRepairDataVo.getRepairId()); |
| | | } |
| | | |
| | | if (repairIds.size() < 1) { |
| | | return; |
| | | } |
| | | RepairUserDto repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairIds(repairIds.toArray(new String[repairIds.size()])); |
| | | List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); |
| | | |
| | | for (RepairUserDto tmpRepairUserDto : repairUserDtos) { |
| | | for (RepairDto apiOwnerRepairDataVo : ownerRepairs) { |
| | | if (tmpRepairUserDto.getRepairId().equals(apiOwnerRepairDataVo.getRepairId())) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.utils.constant.ServiceCodeOwnerRepairConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Autowired |
| | | private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl; |
| | | private IUserInnerServiceSMO userInnerServiceSMO; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IRepairInnerServiceSMO getRepairInnerServiceSMOImpl() { |
| | | return repairInnerServiceSMOImpl; |
| | |
| | | super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求中未包含小区ID"); |
| | | Assert.hasKeyAndValue(reqJson, "userId", "请求中未包含员工信息"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | RepairDto ownerRepairDto = BeanConvertUtil.covertBean(reqJson, RepairDto.class); |
| | | ownerRepairDto.setStaffId(reqJson.getString("userId")); |
| | | |
| | | //获取用户id |
| | | String userId = reqJson.getString("userId"); |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | //查询用户信息 |
| | | List<UserDto> users = userInnerServiceSMO.getUsers(userDto); |
| | | Assert.listOnlyOne(users, "数据异常未找到用户信息"); |
| | | if (!users.get(0).getLevelCd().equals("00")) { //当前用户不是管理员时放入staffId的值 |
| | | ownerRepairDto.setStaffId(reqJson.getString("userId")); |
| | | } |
| | | int count = repairInnerServiceSMOImpl.queryStaffRepairsCount(ownerRepairDto); |
| | | |
| | | |
| | | List<RepairDto> ownerRepairs = null; |
| | | if (count > 0) { |
| | | ownerRepairs = repairInnerServiceSMOImpl.queryStaffRepairs(ownerRepairDto); |
| | | |
| | | //refreshStaffName(ownerRepairs); |
| | | } else { |
| | | ownerRepairs = new ArrayList<>(); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, ownerRepairs); |
| | | |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | // |
| | | // private void refreshStaffName(List<RepairDto> ownerRepairs) { |
| | | // |
| | | // List<String> repairIds = new ArrayList<>(); |
| | | // for (RepairDto apiOwnerRepairDataVo : ownerRepairs) { |
| | | // repairIds.add(apiOwnerRepairDataVo.getRepairId()); |
| | | // } |
| | | // |
| | | // if (repairIds.size() < 1) { |
| | | // return; |
| | | // } |
| | | // RepairUserDto repairUserDto = new RepairUserDto(); |
| | | // repairUserDto.setRepairIds(repairIds.toArray(new String[repairIds.size()])); |
| | | // List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); |
| | | // |
| | | // for (RepairUserDto tmpRepairUserDto : repairUserDtos) { |
| | | // for (RepairDto apiOwnerRepairDataVo : ownerRepairs) { |
| | | // if (tmpRepairUserDto.getRepairId().equals(apiOwnerRepairDataVo.getRepairId())) { |
| | | // apiOwnerRepairDataVo.setStaffId(tmpRepairUserDto.getUserId()); |
| | | // //apiOwnerRepairDataVo.setStatmpRepairUserDto.getUserName()); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // } |
| | | } |
| | |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.file.FileDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.intf.common.IFileInnerServiceSMO; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.intf.fee.IFeeConfigInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; |
| | | import com.java110.po.fee.FeeAttrPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.po.file.FileRelPo; |
| | | import com.java110.po.owner.RepairPoolPo; |
| | | import com.java110.po.owner.RepairUserPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.FeeTypeConstant; |
| | |
| | | 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.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | |
| | | */ |
| | | @Java110Listener("repairCloseListener") |
| | | public class RepairFinishListener extends AbstractServiceApiPlusListener { |
| | | |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(RepairFinishListener.class); |
| | | |
| | |
| | | private IFileInnerServiceSMO fileInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMO; |
| | | private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private IOwnerInnerServiceSMO ownerInnerServiceSMO; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息"); |
| | | Assert.hasKeyAndValue(reqJson, "context", "未包含派单内容"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息"); |
| | | Assert.hasKeyAndValue(reqJson, "amount", "未包含金额"); |
| | | Assert.hasKeyAndValue(reqJson, "feeFlag", "未包含费用标识"); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | String userId = reqJson.getString("userId"); |
| | | String userName = reqJson.getString("userName"); |
| | | |
| | | String publicArea = reqJson.getString("publicArea"); |
| | | //获取报修渠道 |
| | | String repairChannel = reqJson.getString("repairChannel"); |
| | | //获取维修类型 |
| | | String maintenanceType = reqJson.getString("maintenanceType"); |
| | | if (!reqJson.getString("outLowPrice").equals(reqJson.getString("outHighPrice")) |
| | | && maintenanceType.equals("1001")) { |
| | | //获取价格 |
| | | Double price = Double.parseDouble(reqJson.getString("price")); |
| | | //获取最低价 |
| | | Double outLowPrice = Double.parseDouble(reqJson.getString("outLowPrice")); |
| | | //获取最高价 |
| | | Double outHighPrice = Double.parseDouble(reqJson.getString("outHighPrice")); |
| | | //物品价格应该在最低价和最高价之间 |
| | | if (price < outLowPrice || price > outHighPrice) { |
| | | throw new IllegalArgumentException("输入的价格不正确,请重新输入!"); |
| | | } |
| | | } |
| | | RepairUserDto repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairId(reqJson.getString("repairId")); |
| | | repairUserDto.setCommunityId(reqJson.getString("communityId")); |
| | |
| | | repairUserPo.setContext(reqJson.getString("context")); |
| | | repairUserPo.setCommunityId(reqJson.getString("communityId")); |
| | | super.update(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_USER); |
| | | //2.0 给开始节点派支付单 |
| | | repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairId(reqJson.getString("repairId")); |
| | | repairUserDto.setCommunityId(reqJson.getString("communityId")); |
| | | repairUserDto.setRepairEvent(RepairUserDto.REPAIR_EVENT_START_USER); |
| | | repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); |
| | | Assert.listOnlyOne(repairUserDtos, "数据错误 该订单没有发起人"); |
| | | repairUserPo = new RepairUserPo(); |
| | | repairUserPo.setRuId("-1"); |
| | | repairUserPo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | repairUserPo.setState(RepairUserDto.STATE_DOING); |
| | | repairUserPo.setRepairId(reqJson.getString("repairId")); |
| | | repairUserPo.setStaffId(repairUserDtos.get(0).getStaffId()); |
| | | repairUserPo.setStaffName(repairUserDtos.get(0).getStaffName()); |
| | | repairUserPo.setPreStaffId(userId); |
| | | repairUserPo.setPreStaffName(userName); |
| | | repairUserPo.setPreRuId(repairUserDtos.get(0).getRuId()); |
| | | repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_PAY_USER); |
| | | repairUserPo.setContext(""); |
| | | repairUserPo.setCommunityId(reqJson.getString("communityId")); |
| | | super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER); |
| | | |
| | | if (repairChannel.equals("Z") || (!StringUtil.isEmpty(maintenanceType) && maintenanceType.equals("1001"))) { //如果是业主报修或者是有偿的就生成一条新状态,否则不变 |
| | | //2.0 给开始节点派支付单 |
| | | repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairId(reqJson.getString("repairId")); |
| | | repairUserDto.setCommunityId(reqJson.getString("communityId")); |
| | | repairUserDto.setRepairEvent(RepairUserDto.REPAIR_EVENT_START_USER); |
| | | repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); |
| | | Assert.listOnlyOne(repairUserDtos, "数据错误 该订单没有发起人"); |
| | | repairUserPo = new RepairUserPo(); |
| | | repairUserPo.setRuId("-1"); |
| | | repairUserPo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | if (maintenanceType.equals("1001")) { //如果是有偿的就走下面(业主报修有偿或者电话申请有偿或者员工报修有偿) |
| | | repairUserPo.setState(RepairUserDto.STATE_PAY_FEE); |
| | | } else { |
| | | repairUserPo.setState(RepairUserDto.STATE_EVALUATE); |
| | | } |
| | | repairUserPo.setRepairId(reqJson.getString("repairId")); |
| | | if (repairChannel.equals("Z")) { //如果是业主端报修的走下面的方法 |
| | | repairUserPo.setStaffId(repairUserDtos.get(0).getStaffId()); |
| | | repairUserPo.setStaffName(repairUserDtos.get(0).getStaffName()); |
| | | } else { //如果不是业主报修,并且有偿 |
| | | RepairDto repairDto = new RepairDto(); |
| | | repairDto.setRepairId(reqJson.getString("repairId")); |
| | | List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto); |
| | | Assert.listOnlyOne(repairDtos, "数据错误 该用户没有报修单"); |
| | | //此时的报修对象ID即房屋ID |
| | | String roomId = repairDtos.get(0).getRepairObjId(); |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setRoomId(roomId); |
| | | //查询房屋业主关系表 |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMO.queryOwnerRoomRels(ownerRoomRelDto); |
| | | Assert.listOnlyOne(ownerRoomRelDtos, "信息错误"); |
| | | //获取业主id |
| | | String ownerId = ownerRoomRelDtos.get(0).getOwnerId(); |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setOwnerId(ownerId); |
| | | //根据业主id查询业主信息 |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMO.queryOwners(ownerDto); |
| | | Assert.listOnlyOne(ownerDtos, "信息错误"); |
| | | //获取业主姓名 |
| | | String ownerName = ownerDtos.get(0).getName(); |
| | | repairUserPo.setStaffId(ownerId); |
| | | repairUserPo.setStaffName(ownerName); |
| | | } |
| | | repairUserPo.setPreStaffId(userId); |
| | | repairUserPo.setPreStaffName(userName); |
| | | repairUserPo.setPreRuId(repairUserDtos.get(0).getRuId()); |
| | | repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_PAY_USER); |
| | | repairUserPo.setContext(""); |
| | | repairUserPo.setCommunityId(reqJson.getString("communityId")); |
| | | super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER); |
| | | } |
| | | //维修前图片处理 |
| | | if (reqJson.containsKey("beforeRepairPhotos") && !StringUtils.isEmpty(reqJson.getString("beforeRepairPhotos"))) { |
| | | JSONArray beforeRepairPhotos = reqJson.getJSONArray("beforeRepairPhotos"); |
| | |
| | | businessUnit.put("fileRealName", fileName); |
| | | businessUnit.put("fileSaveName", fileName); |
| | | FileRelPo fileRelPo = BeanConvertUtil.covertBean(businessUnit, FileRelPo.class); |
| | | fileRelInnerServiceSMO.saveFileRel(fileRelPo); |
| | | // super.insert(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | super.insert(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | } |
| | | } |
| | | |
| | | //维修后图片处理 |
| | | if (reqJson.containsKey("afterRepairPhotos") && !StringUtils.isEmpty(reqJson.getString("afterRepairPhotos"))) { |
| | | JSONArray afterRepairPhotos = reqJson.getJSONArray("afterRepairPhotos"); |
| | |
| | | businessUnit.put("fileRealName", fileName); |
| | | businessUnit.put("fileSaveName", fileName); |
| | | FileRelPo fileRelPo = BeanConvertUtil.covertBean(businessUnit, FileRelPo.class); |
| | | fileRelInnerServiceSMO.saveFileRel(fileRelPo); |
| | | // super.insert(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | super.insert(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | } |
| | | } |
| | | |
| | | if ("200".equals(reqJson.getString("feeFlag"))) { // 没有费用 |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_APPRAISE); |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_OK, ResultVo.MSG_OK); |
| | | context.setResponseEntity(responseEntity); |
| | | return; |
| | | if (publicArea.equals("F") && "1002".equals(reqJson.getString("maintenanceType"))) { //如果不是公共区域且是无偿的走下面 |
| | | //改变r_repair_pool表maintenance_type维修类型 |
| | | RepairPoolPo repairPoolPo = new RepairPoolPo(); |
| | | repairPoolPo.setRepairId(reqJson.getString("repairId")); |
| | | repairPoolPo.setMaintenanceType(reqJson.getString("maintenanceType")); |
| | | super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR); |
| | | if (repairChannel.equals("T") || repairChannel.equals("D")) { //如果是电话报修和员工代客报修结单后状态变为待回访 |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_RETURN_VISIT); |
| | | } else if (repairChannel.equals("Z")) { //如果是业主自主报修结单后状态变为待评价 |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_APPRAISE); |
| | | } |
| | | } else if (publicArea.equals("F") && "1001".equals(reqJson.getString("maintenanceType"))) { //如果不是公共区域且是有偿的走下面 |
| | | //3.0 生成支付费用 |
| | | //查询默认费用项 |
| | | FeeConfigDto feeConfigDto = new FeeConfigDto(); |
| | | feeConfigDto.setCommunityId(reqJson.getString("communityId")); |
| | | feeConfigDto.setFeeTypeCd(FeeTypeConstant.FEE_TYPE_REPAIR); |
| | | feeConfigDto.setIsDefault(FeeConfigDto.DEFAULT_FEE_CONFIG); |
| | | List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); |
| | | Assert.listOnlyOne(feeConfigDtos, "默认维修费用有多条或不存在"); |
| | | PayFeePo feePo = new PayFeePo(); |
| | | feePo.setAmount(reqJson.getString("price")); |
| | | feePo.setCommunityId(reqJson.getString("communityId")); |
| | | feePo.setConfigId(feeConfigDtos.get(0).getConfigId()); |
| | | feePo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | feePo.setFeeFlag(feeConfigDtos.get(0).getFeeFlag()); |
| | | feePo.setFeeId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId)); |
| | | feePo.setFeeTypeCd(FeeTypeConstant.FEE_TYPE_REPAIR); |
| | | feePo.setIncomeObjId(reqJson.getString("storeId")); |
| | | feePo.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM); |
| | | RepairDto repairDto = new RepairDto(); |
| | | repairDto.setCommunityId(reqJson.getString("communityId")); |
| | | repairDto.setRepairId(reqJson.getString("repairId")); |
| | | List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto); |
| | | Assert.listOnlyOne(repairDtos, "维修单有多条或不存在"); |
| | | feePo.setPayerObjId(repairDtos.get(0).getRepairObjId()); |
| | | feePo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | feePo.setState(FeeDto.STATE_DOING); |
| | | feePo.setUserId(userId); |
| | | super.insert(context, feePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO); |
| | | FeeAttrPo feeAttrPo = new FeeAttrPo(); |
| | | feeAttrPo.setAttrId("-1"); |
| | | feeAttrPo.setFeeId(feePo.getFeeId()); |
| | | feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_REPAIR); |
| | | feeAttrPo.setCommunityId(reqJson.getString("communityId")); |
| | | feeAttrPo.setValue(reqJson.getString("repairId")); |
| | | super.insert(context, feeAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO); |
| | | //改变r_repair_pool表maintenance_type维修类型 |
| | | RepairPoolPo repairPoolPo = new RepairPoolPo(); |
| | | repairPoolPo.setRepairId(reqJson.getString("repairId")); |
| | | repairPoolPo.setMaintenanceType(reqJson.getString("maintenanceType")); |
| | | super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR); |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_PAY); |
| | | } else if (publicArea.equals("T")) { //公共区域走这里 |
| | | if (repairChannel.equals("T") || repairChannel.equals("D")) { //如果是电话报修和员工代客报修结单后状态变为待回访 |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_RETURN_VISIT); |
| | | } else if (repairChannel.equals("Z")) { //如果是业主自主报修结单后状态变为待评价 |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_APPRAISE); |
| | | } |
| | | } |
| | | //3.0 生成支付费用 |
| | | //查询默认费用项 |
| | | FeeConfigDto feeConfigDto = new FeeConfigDto(); |
| | | feeConfigDto.setCommunityId(reqJson.getString("communityId")); |
| | | feeConfigDto.setFeeTypeCd(FeeTypeConstant.FEE_TYPE_REPAIR); |
| | | feeConfigDto.setIsDefault(FeeConfigDto.DEFAULT_FEE_CONFIG); |
| | | List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto); |
| | | |
| | | Assert.listOnlyOne(feeConfigDtos, "默认维修费用有多条或不存在"); |
| | | |
| | | PayFeePo feePo = new PayFeePo(); |
| | | feePo.setAmount(reqJson.getString("amount")); |
| | | feePo.setCommunityId(reqJson.getString("communityId")); |
| | | feePo.setConfigId(feeConfigDtos.get(0).getConfigId()); |
| | | feePo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | feePo.setFeeFlag(feeConfigDtos.get(0).getFeeFlag()); |
| | | feePo.setFeeId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId)); |
| | | feePo.setFeeTypeCd(FeeTypeConstant.FEE_TYPE_REPAIR); |
| | | feePo.setIncomeObjId(reqJson.getString("storeId")); |
| | | feePo.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM); |
| | | RepairDto repairDto = new RepairDto(); |
| | | repairDto.setCommunityId(reqJson.getString("communityId")); |
| | | repairDto.setRepairId(reqJson.getString("repairId")); |
| | | List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto); |
| | | Assert.listOnlyOne(repairDtos, "维修单有多条或不存在"); |
| | | |
| | | feePo.setPayerObjId(repairDtos.get(0).getRepairObjId()); |
| | | feePo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | feePo.setState(FeeDto.STATE_DOING); |
| | | feePo.setUserId(userId); |
| | | super.insert(context, feePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO); |
| | | |
| | | FeeAttrPo feeAttrPo = new FeeAttrPo(); |
| | | feeAttrPo.setAttrId("-1"); |
| | | feeAttrPo.setFeeId(feePo.getFeeId()); |
| | | feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_REPAIR); |
| | | feeAttrPo.setCommunityId(reqJson.getString("communityId")); |
| | | feeAttrPo.setValue(reqJson.getString("repairId")); |
| | | super.insert(context, feeAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO); |
| | | |
| | | ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_PAY); |
| | | |
| | | |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_OK, ResultVo.MSG_OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.ownerRepair.IOwnerRepairBMO; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | |
| | | public class SaveOwnerRepairListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private IOwnerRepairBMO ownerRepairBMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileInnerServiceSMO fileInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "repairType", "必填,请选择报修类型"); |
| | | Assert.hasKeyAndValue(reqJson, "repairName", "必填,请填写报修人名称"); |
| | | Assert.hasKeyAndValue(reqJson, "tel", "必填,请填写报修人手机号"); |
| | |
| | | Assert.hasKeyAndValue(reqJson, "userId", "必填,请填写提交用户ID"); |
| | | Assert.hasKeyAndValue(reqJson, "userName", "必填,请填写提交用户名称"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区ID"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | JSONObject businessOwnerRepair = new JSONObject(); |
| | | businessOwnerRepair.putAll(reqJson); |
| | | businessOwnerRepair.put("repairId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_repairId)); |
| | |
| | | repairUserPo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | repairUserPo.setRuId("-1"); |
| | | super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER); |
| | | |
| | | |
| | | if (reqJson.containsKey("photos") && !StringUtils.isEmpty(reqJson.getString("photos"))) { |
| | | JSONArray photos = reqJson.getJSONArray("photos"); |
| | | for (int _photoIndex = 0; _photoIndex < photos.size(); _photoIndex++) { |
| | |
| | | String fileName = fileInnerServiceSMOImpl.saveFile(fileDto); |
| | | reqJson.put("ownerPhotoId", fileDto.getFileId()); |
| | | reqJson.put("fileSaveName", fileName); |
| | | |
| | | JSONObject businessUnit = new JSONObject(); |
| | | businessUnit.put("fileRelId", "-" + (_photoIndex + 1)); |
| | | businessUnit.put("relTypeCd", FileRelDto.REL_TYPE_CD_REPAIR); |
| | |
| | | super.insert(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "resId", "物品ID不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "商户信息不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | resourceStoreBMOImpl.deleteResourceStore(reqJson, context); |
| | | } |
| | | |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IResourceStoreInnerServiceSMO getResourceStoreInnerServiceSMOImpl() { |
| | | return resourceStoreInnerServiceSMOImpl; |
| | |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | ResourceStoreDto resourceStoreDto = BeanConvertUtil.covertBean(reqJson, ResourceStoreDto.class); |
| | | |
| | | int count = resourceStoreInnerServiceSMOImpl.queryResourceStoresCount(resourceStoreDto); |
| | | |
| | | List<ApiResourceStoreDataVo> resourceStores = null; |
| | | |
| | | List<ApiResourceStoreDataVo> resourceStores = new ArrayList<>(); |
| | | if (count > 0) { |
| | | resourceStores = BeanConvertUtil.covertBeanList(resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto), ApiResourceStoreDataVo.class); |
| | | List<ApiResourceStoreDataVo> apiResourceStoreDataVos = BeanConvertUtil.covertBeanList(resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto), ApiResourceStoreDataVo.class); |
| | | for (ApiResourceStoreDataVo apiResourceStoreDataVo : apiResourceStoreDataVos) { |
| | | if (apiResourceStoreDataVo.getOutLowPrice().equals(apiResourceStoreDataVo.getOutHighPrice())) { |
| | | apiResourceStoreDataVo.setOutPrice(apiResourceStoreDataVo.getOutLowPrice() + "元"); |
| | | } else { |
| | | apiResourceStoreDataVo.setOutPrice(apiResourceStoreDataVo.getOutLowPrice() + "元-" + apiResourceStoreDataVo.getOutHighPrice() + "元"); |
| | | } |
| | | resourceStores.add(apiResourceStoreDataVo); |
| | | } |
| | | } else { |
| | | resourceStores = new ArrayList<>(); |
| | | } |
| | | |
| | | ApiResourceStoreVo apiResourceStoreVo = new ApiResourceStoreVo(); |
| | | |
| | | apiResourceStoreVo.setTotal(count); |
| | | apiResourceStoreVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiResourceStoreVo.setResourceStores(resourceStores); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiResourceStoreVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Java110Listener("saveResourceStoreListener") |
| | | public class SaveResourceStoreListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private IResourceStoreBMO resourceStoreBMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "resName", "必填,请填写物品名称"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户信息"); |
| | | //Assert.hasKeyAndValue(reqJson, "resCode", "必填,请填写物品编码"); |
| | | Assert.hasKeyAndValue(reqJson, "price", "必填,请填写物品价格"); |
| | | /*Assert.hasKeyAndValue(reqJson, "stock", "必填,请填写物品库存"); |
| | | Assert.hasKeyAndValue(reqJson, "description", "必填,请填写描述");*/ |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | resourceStoreBMOImpl.addResourceStore(reqJson, context); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "resId", "物品ID不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "resName", "必填,请填写物品名称"); |
| | | //Assert.hasKeyAndValue(reqJson, "resCode", "必填,请填写物品编码"); |
| | |
| | | //Assert.hasKeyAndValue(reqJson, "stock", "必填,请填写物品库存"); |
| | | //Assert.hasKeyAndValue(reqJson, "description", "必填,请填写描述"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "商户信息不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | resourceStoreBMOImpl.updateResourceStore(reqJson, context); |
| | | } |
| | | |
| | |
| | | smallWechatAttrPo.setAttrId("-3"); |
| | | smallWechatAttrPo.setCommunityId(reqJson.getString("objId")); |
| | | smallWechatAttrPo.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_HOUSE_DECORATION_COMPLETED_TEMPLATE); |
| | | smallWechatAttrPo.setValue("这里装修验收结果提醒给业主,通知模板ID"); |
| | | smallWechatAttrPo.setValue("这里请填写装修验收结果提醒给业主,通知模板ID"); |
| | | smallWechatAttrPo.setWechatId(wechatId); |
| | | super.insert(context, smallWechatAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_SMALL_WECHAT_ATTR); |
| | | |
| | | |
| | | //报修通知-上门维修现场收费通知业主 通知--模板ID |
| | | smallWechatAttrPo = new SmallWechatAttrPo(); |
| | | smallWechatAttrPo.setAttrId("-3"); |
| | | smallWechatAttrPo.setCommunityId(reqJson.getString("objId")); |
| | | smallWechatAttrPo.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_REPAIR_CHARGE_SCENE_TEMPLATE); |
| | | smallWechatAttrPo.setValue("这里请填写上门维修现场收费,提醒业主缴费,通知模板ID"); |
| | | smallWechatAttrPo.setWechatId(wechatId); |
| | | super.insert(context, smallWechatAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_SMALL_WECHAT_ATTR); |
| | | |
| | |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("relTypeCd")) { |
| | | if (info.containsKey("obj_id")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("rel_type_cd")) { |
| | | if (!businessInfo.containsKey("obj_id")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("relTypeCd", businessInfo.get("rel_type_cd")); |
| | | info.put("obj_id", businessInfo.get("obj_id")); |
| | | } |
| | | |
| | | /** |
| New file |
| | |
| | | package com.java110.community.api; |
| | | |
| | | import com.java110.community.bmo.resourceStore.IGetResourceStoreBMO; |
| | | import com.java110.po.purchase.ResourceStorePo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/resourceStore") |
| | | public class ResourceStoreApi { |
| | | |
| | | @Autowired |
| | | private IGetResourceStoreBMO getResourceStoreBMO; |
| | | |
| | | /** |
| | | * 根据商品类型查询商品信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | * @serviceCode /resourceStore/queryResourceStoreResName |
| | | * @path /app/resourceStore/queryResourceStoreResName |
| | | */ |
| | | @RequestMapping(value = "/queryResourceStoreResName", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryResourceStoreResName(@RequestParam(value = "goodsType", required = false) String goodsType) { |
| | | ResourceStorePo resourceStorePo = new ResourceStorePo(); |
| | | resourceStorePo.setGoodsType(goodsType); |
| | | return getResourceStoreBMO.get(resourceStorePo); |
| | | } |
| | | |
| | | /** |
| | | * 根据资源id查询商品信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | * @serviceCode /resourceStore/queryResourceStorePrice |
| | | * @path /app/resourceStore/queryResourceStorePrice |
| | | */ |
| | | @RequestMapping(value = "/queryResourceStorePrice", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryResourceStorePrice(@RequestParam(value = "resId", required = false) String resId) { |
| | | ResourceStorePo resourceStorePo = new ResourceStorePo(); |
| | | resourceStorePo.setResId(resId); |
| | | return getResourceStoreBMO.get(resourceStorePo); |
| | | } |
| | | } |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/roomRenovation") |
| | | public class RoomRenovationApi { |
| | |
| | | package com.java110.community.bmo.repair; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.appraise.AppraiseDto; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | /** |
| | | * 保存评价接口类 |
| | |
| | | |
| | | /** |
| | | * 保存接口评价 |
| | | * |
| | | * @param appraiseDto |
| | | * @return |
| | | */ |
| | |
| | | import com.java110.dto.appraise.AppraiseDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.common.IAppraiseInnerServiceSMO; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.po.appraise.AppraisePo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.vo.ResultVo; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * 报修评价 |
| | |
| | | |
| | | @Autowired |
| | | private IAppraiseInnerServiceSMO appraiseInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRepairServiceDao repairServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IRepairUserServiceDao repairUserServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMO; |
| | | |
| | | @Override |
| | | @Java110Transactional |
| | | public ResponseEntity<String> appraiseRepair(@RequestBody AppraiseDto appraiseDto) { |
| | | |
| | | |
| | | //获取装修id |
| | | String repairId = appraiseDto.getObjId(); |
| | | Map repairInfo = new HashMap(); |
| | | repairInfo.put("repairId", repairId); |
| | | repairInfo.put("state", RepairUserDto.STATE_EVALUATE); |
| | | List<Map> repairUserInfo = repairUserServiceDaoImpl.getRepairUserInfo(repairInfo); |
| | | Assert.listOnlyOne(repairUserInfo, "该用户没有待评价的报修单"); |
| | | Map info = new HashMap(); |
| | | info.put("ruId", repairUserInfo.get(0).get("ruId")); |
| | | info.put("repairId", appraiseDto.getObjId()); |
| | | info.put("staffId", appraiseDto.getAppraiseUserId()); |
| | | info.put("state", RepairUserDto.STATE_CLOSE); |
| | | info.put("state", RepairUserDto.STATE_FINISH); |
| | | info.put("endTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | info.put("context", "评价完成"); |
| | | info.put("context", appraiseDto.getContext()); |
| | | info.put("statusCd", "0"); |
| | | repairUserServiceDaoImpl.updateRepairUserInfoInstance(info); |
| | | //将工单表的状态修改为完成 |
| | |
| | | info.put("statusCd", "0"); |
| | | info.put("state", RepairDto.STATE_RETURN_VISIT); |
| | | repairServiceDaoImpl.updateRepairInfoInstance(info); |
| | | |
| | | |
| | | //评价表中加入评价内容 |
| | | AppraisePo appraisePo = BeanConvertUtil.covertBean(appraiseDto, AppraisePo.class); |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(appraisePo.getAppraiseUserId()); |
| | | List<UserDto> users = userInnerServiceSMO.getUsers(userDto); |
| | | Assert.listOnlyOne(users, "信息错误,用户不存在!"); |
| | | appraisePo.setAppraiseUserName(users.get(0).getName()); |
| | | appraisePo.setParentAppraiseId("-1"); |
| | | appraisePo.setObjType(AppraiseDto.OBJ_TYPE_REPAIR); |
| | | appraisePo.setAppraiseType(AppraiseDto.APPRAISE_TYPE_PUBLIC); |
| | | |
| | | appraiseInnerServiceSMOImpl.saveAppraise(appraisePo); |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, ResultVo.MSG_OK); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.bmo.resourceStore; |
| | | |
| | | import com.java110.po.purchase.ResourceStorePo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 查询资源表物品信息 |
| | | * |
| | | * @author fqz |
| | | * @date 2021-03-17 11:22 |
| | | */ |
| | | public interface IGetResourceStoreBMO { |
| | | |
| | | /** |
| | | * 查询资源表物品信息 |
| | | * |
| | | * @param resourceStorePo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(ResourceStorePo resourceStorePo); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.bmo.resourceStore.impl; |
| | | |
| | | import com.java110.community.bmo.resourceStore.IGetResourceStoreBMO; |
| | | import com.java110.intf.community.IResourceStoreServiceSMO; |
| | | import com.java110.po.purchase.ResourceStorePo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询资源物品信息 |
| | | * |
| | | * @author fqz |
| | | * @date 2021-03-17 11:27 |
| | | */ |
| | | @Service("getResourceStoreBMOImpl") |
| | | public class GetResourceStoreBMOImpl implements IGetResourceStoreBMO { |
| | | |
| | | @Autowired |
| | | private IResourceStoreServiceSMO resourceStoreServiceSMO; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> get(ResourceStorePo resourceStorePo) { |
| | | int count = resourceStoreServiceSMO.getResourceStoresCount(resourceStorePo); |
| | | List<ResourceStorePo> resourceStorePos = null; |
| | | if (count > 0) { |
| | | resourceStorePos = resourceStoreServiceSMO.getResourceStores(resourceStorePo); |
| | | } else { |
| | | resourceStorePos = new ArrayList<>(); |
| | | } |
| | | ResultVo resultVo = new ResultVo(count, count, resourceStorePos); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | return responseEntity; |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询装修记录信息实体类 |
| | | * 查询装修记录信息 |
| | | * |
| | | * @author fqz |
| | | * @date 2021-02-23 17:02 |
| | |
| | | package com.java110.community.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * 报修信息组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 报修信息服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * <p> |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IRepairServiceDao { |
| | | |
| | | /** |
| | | * 保存 报修信息信息 |
| | | * |
| | | * @param businessRepairInfo 报修信息信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessRepairInfo(Map businessRepairInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询报修信息信息(business过程) |
| | | * 根据bId 查询报修信息信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 报修信息信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessRepairInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 报修信息信息 Business数据到 Instance中 |
| | | * |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveRepairInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询报修信息信息(instance过程) |
| | | * 根据bId 查询报修信息信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 报修信息信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getRepairInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改报修信息信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateRepairInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询报修信息总数 |
| | |
| | | */ |
| | | int queryRepairsCount(Map info); |
| | | |
| | | |
| | | /** |
| | | * 查询报修信息信息(instance过程) |
| | | * 根据bId 查询报修信息信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 报修信息信息 |
| | | * @throws DAOException DAO异常 |
| | |
| | | */ |
| | | int queryStaffRepairsCount(Map info); |
| | | |
| | | |
| | | /** |
| | | * 查询报修信息信息(instance过程) |
| | | * 根据bId 查询报修信息信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 报修信息信息 |
| | | * @throws DAOException DAO异常 |
| | |
| | | * @return 报修信息数量 |
| | | */ |
| | | int queryStaffFinishRepairsCount(Map info); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IResourceStoreServiceDao { |
| | | |
| | | /** |
| | | * 获取资源物品信息 |
| | | * |
| | | * @param info |
| | | * @return |
| | | */ |
| | | List<Map> getResourceStoresInfo(Map info); |
| | | |
| | | /** |
| | | * 获取资源物品数量 |
| | | * |
| | | * @param info |
| | | * @return |
| | | */ |
| | | int getResourceStoresCount(Map info); |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 报修信息信息封装 |
| | | * |
| | | * @param businessRepairInfo 报修信息信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | |
| | | public void saveBusinessRepairInfo(Map businessRepairInfo) throws DAOException { |
| | | businessRepairInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存报修信息信息 入参 businessRepairInfo : {}",businessRepairInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("repairServiceDaoImpl.saveBusinessRepairInfo",businessRepairInfo); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存报修信息数据失败:"+ JSONObject.toJSONString(businessRepairInfo)); |
| | | logger.debug("保存报修信息信息 入参 businessRepairInfo : {}", businessRepairInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("repairServiceDaoImpl.saveBusinessRepairInfo", businessRepairInfo); |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存报修信息数据失败:" + JSONObject.toJSONString(businessRepairInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询报修信息信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 报修信息信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessRepairInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询报修信息信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getBusinessRepairInfo",info); |
| | | |
| | | logger.debug("查询报修信息信息 入参 info : {}", info); |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getBusinessRepairInfo", info); |
| | | return businessRepairInfos; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存报修信息信息 到 instance |
| | | * @param info bId 信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveRepairInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存报修信息信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("repairServiceDaoImpl.saveRepairInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存报修信息信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | logger.debug("保存报修信息信息Instance 入参 info : {}", info); |
| | | int saveFlag = sqlSessionTemplate.insert("repairServiceDaoImpl.saveRepairInfoInstance", info); |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存报修信息信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询报修信息信息(instance) |
| | | * |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getRepairInfo(Map info) throws DAOException { |
| | | logger.debug("查询报修信息信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getRepairInfo",info); |
| | | |
| | | logger.debug("查询报修信息信息 入参 info : {}", info); |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getRepairInfo", info); |
| | | return businessRepairInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改报修信息信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateRepairInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改报修信息信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("repairServiceDaoImpl.updateRepairInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改报修信息信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | logger.debug("修改报修信息信息Instance 入参 info : {}", info); |
| | | int saveFlag = sqlSessionTemplate.update("repairServiceDaoImpl.updateRepairInfoInstance", info); |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改报修信息信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | /** |
| | | * 查询报修信息数量 |
| | | * |
| | | * @param info 报修信息信息 |
| | | * @return 报修信息数量 |
| | | */ |
| | | @Override |
| | | public int queryRepairsCount(Map info) { |
| | | logger.debug("查询报修信息数据 入参 info : {}",info); |
| | | |
| | | logger.debug("查询报修信息数据 入参 info : {}", info); |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.queryRepairsCount", info); |
| | | if (businessRepairInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessRepairInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> getStaffRepairInfo(Map info) throws DAOException { |
| | | logger.debug("查询报修信息信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getStaffRepairInfo",info); |
| | | |
| | | logger.debug("查询报修信息信息 入参 info : {}", info); |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getStaffRepairInfo", info); |
| | | return businessRepairInfos; |
| | | } |
| | | |
| | | @Override |
| | | public int queryStaffRepairsCount(Map info) { |
| | | logger.debug("查询报修信息数据 入参 info : {}",info); |
| | | |
| | | logger.debug("查询报修信息数据 入参 info : {}", info); |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.queryStaffRepairsCount", info); |
| | | if (businessRepairInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessRepairInfos.get(0).get("count").toString()); } |
| | | return Integer.parseInt(businessRepairInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map> getStaffFinishRepairInfo(Map info) throws DAOException { |
| | | logger.debug("查询报修信息信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getStaffFinishRepairInfo",info); |
| | | |
| | | logger.debug("查询报修信息信息 入参 info : {}", info); |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getStaffFinishRepairInfo", info); |
| | | return businessRepairInfos; |
| | | } |
| | | |
| | | @Override |
| | | public int queryStaffFinishRepairsCount(Map info) { |
| | | logger.debug("查询报修信息数据 入参 info : {}",info); |
| | | |
| | | logger.debug("查询报修信息数据 入参 info : {}", info); |
| | | List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.queryStaffFinishRepairsCount", info); |
| | | if (businessRepairInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessRepairInfos.get(0).get("count").toString()); } |
| | | return Integer.parseInt(businessRepairInfos.get(0).get("count").toString()); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao.impl; |
| | | |
| | | import com.java110.community.dao.IResourceStoreServiceDao; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 物品信息 |
| | | * |
| | | * @author fqz |
| | | * @date 2021-03-17 11:48 |
| | | */ |
| | | @Service("resourceStoreServiceDaoImpl") |
| | | public class ResourceStoreServiceDaoImpl extends BaseServiceDao implements IResourceStoreServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ResourceStoreServiceDaoImpl.class); |
| | | |
| | | @Override |
| | | public List<Map> getResourceStoresInfo(Map info) { |
| | | logger.debug("查询资源物品信息 入参 info : {}", info); |
| | | List<Map> businessRoomRenovationInfos = sqlSessionTemplate.selectList("resourceStoreServiceDaoImpl.getResourceStoresInfo", info); |
| | | return businessRoomRenovationInfos; |
| | | } |
| | | |
| | | @Override |
| | | public int getResourceStoresCount(Map info) { |
| | | logger.debug("查询资源物品数量 入参 info : {}", info); |
| | | List<Map> businessRoomRenovationInfos = sqlSessionTemplate.selectList("resourceStoreServiceDaoImpl.getResourceStoresCount", info); |
| | | if (businessRoomRenovationInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | return Integer.parseInt(businessRoomRenovationInfos.get(0).get("count").toString()); |
| | | } |
| | | } |
| | |
| | | businessRepairInfo.put("repairObjType", businessRepairInfo.get("repair_obj_type")); |
| | | businessRepairInfo.put("repairObjId", businessRepairInfo.get("repair_obj_id")); |
| | | businessRepairInfo.put("repairObjName", businessRepairInfo.get("repair_obj_name")); |
| | | businessRepairInfo.put("repairChannel", businessRepairInfo.get("repair_channel")); |
| | | businessRepairInfo.put("maintenanceType", businessRepairInfo.get("maintenance_type")); |
| | | businessRepairInfo.remove("bId"); |
| | | businessRepairInfo.put("statusCd", statusCd); |
| | | } |
| | |
| | | currentRepairInfo.put("repairObjType", currentRepairInfo.get("repair_obj_type")); |
| | | currentRepairInfo.put("repairObjId", currentRepairInfo.get("repair_obj_id")); |
| | | currentRepairInfo.put("repairObjName", currentRepairInfo.get("repair_obj_name")); |
| | | |
| | | currentRepairInfo.put("repairChannel", currentRepairInfo.get("repair_channel")); |
| | | currentRepairInfo.put("maintenanceType", currentRepairInfo.get("maintenance_type")); |
| | | |
| | | currentRepairInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getRepairServiceDaoImpl().saveBusinessRepairInfo(currentRepairInfo); |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | |
| | | import com.java110.community.dao.IRepairServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | |
| | | |
| | | @Override |
| | | public List<RepairDto> queryRepairs(@RequestBody RepairDto repairDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = repairDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | repairDto.setPage((page - 1) * repairDto.getRow()); |
| | | } |
| | | |
| | | List<RepairDto> repairs = BeanConvertUtil.covertBeanList(repairServiceDaoImpl.getRepairInfo(BeanConvertUtil.beanCovertMap(repairDto)), RepairDto.class); |
| | | |
| | | |
| | | return repairs; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryRepairsCount(@RequestBody RepairDto repairDto) { |
| | |
| | | @Override |
| | | public List<RepairDto> queryStaffRepairs(@RequestBody RepairDto repairDto) { |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = repairDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | repairDto.setPage((page - 1) * repairDto.getRow()); |
| | | } |
| | | |
| | | List<RepairDto> repairs = BeanConvertUtil.covertBeanList(repairServiceDaoImpl.getStaffRepairInfo(BeanConvertUtil.beanCovertMap(repairDto)), RepairDto.class); |
| | | |
| | | |
| | | return repairs; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<RepairDto> queryStaffFinishRepairs(@RequestBody RepairDto repairDto) { |
| | | |
| | | int page = repairDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | repairDto.setPage((page - 1) * repairDto.getRow()); |
| | | } |
| | | |
| | | List<RepairDto> repairs = BeanConvertUtil.covertBeanList(repairServiceDaoImpl.getStaffFinishRepairInfo(BeanConvertUtil.beanCovertMap(repairDto)), RepairDto.class); |
| | | |
| | | |
| | | return repairs; |
| | | } |
| | | |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | |
| | | import com.java110.community.dao.IRepairUserServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.po.owner.RepairUserPo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<RepairUserDto> queryRepairUsers(@RequestBody RepairUserDto repairUserDto) { |
| | | public List<RepairUserDto> queryRepairUsers(@RequestBody RepairUserDto repairUserDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | |
| | | * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中 |
| | | * |
| | | * @param repairUser 小区报修派单信息 |
| | | * @param users 用户列表 |
| | | * @param users 用户列表 |
| | | */ |
| | | private void refreshRepairUser(RepairUserDto repairUser, List<UserDto> users) { |
| | | for (UserDto user : users) { |
| | |
| | | |
| | | @Override |
| | | public int queryRepairUsersCount(@RequestBody RepairUserDto repairUserDto) { |
| | | return repairUserServiceDaoImpl.queryRepairUsersCount(BeanConvertUtil.beanCovertMap(repairUserDto)); } |
| | | return repairUserServiceDaoImpl.queryRepairUsersCount(BeanConvertUtil.beanCovertMap(repairUserDto)); |
| | | } |
| | | |
| | | @Override |
| | | public void saveRepairUser(RepairUserPo repairUserPo) { |
| | | repairUserServiceDaoImpl.saveRepairUserInfoInstance(BeanConvertUtil.beanCovertMap(repairUserPo)); |
| | | } |
| | | |
| | | public IRepairUserServiceDao getRepairUserServiceDaoImpl() { |
| | | return repairUserServiceDaoImpl; |
| New file |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | import com.java110.community.dao.IResourceStoreServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.intf.community.IResourceStoreServiceSMO; |
| | | import com.java110.po.purchase.ResourceStorePo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | public class ResourceStoreServiceSMOImpl extends BaseServiceSMO implements IResourceStoreServiceSMO { |
| | | |
| | | @Autowired |
| | | private IResourceStoreServiceDao resourceStoreServiceDao; |
| | | |
| | | @Override |
| | | public List<ResourceStorePo> getResourceStores(@RequestBody ResourceStorePo resourceStorePo) { |
| | | List<ResourceStorePo> resourceStorePos = BeanConvertUtil.covertBeanList(resourceStoreServiceDao.getResourceStoresInfo(BeanConvertUtil.beanCovertMap(resourceStorePo)), ResourceStorePo.class); |
| | | return resourceStorePos; |
| | | } |
| | | |
| | | @Override |
| | | public int getResourceStoresCount(@RequestBody ResourceStorePo resourceStorePo) { |
| | | return resourceStoreServiceDao.getResourceStoresCount(BeanConvertUtil.beanCovertMap(resourceStorePo)); |
| | | } |
| | | } |
| | |
| | | package com.java110.job.adapt.Repair; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.factory.WechatFactory; |
| | | import com.java110.dto.basePrivilege.BasePrivilegeDto; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.owner.OwnerAppUserDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairSettingDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.dto.smallWeChat.SmallWeChatDto; |
| | | import com.java110.dto.smallWechatAttr.SmallWechatAttrDto; |
| | |
| | | import com.java110.entity.wechat.PropertyFeeTemplateMessage; |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairSettingInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.intf.order.IPrivilegeInnerServiceSMO; |
| | | import com.java110.intf.store.ISmallWeChatInnerServiceSMO; |
| | | import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO; |
| | | import com.java110.intf.user.*; |
| | | import com.java110.job.adapt.DatabusAdaptImpl; |
| | | import com.java110.po.fee.PayFeePo; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @Autowired |
| | | private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private IRepairSettingInnerServiceSMO repairSettingInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMO; |
| | | |
| | | //模板信息推送地址 |
| | | private static String sendMsgUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="; |
| | | |
| | | @Override |
| | | public void execute(Business business, List<Business> businesses) { |
| | | public void execute(Business business, List<Business> businesses) throws Exception { |
| | | RepairUserDto repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setbId(business.getbId()); |
| | | repairUserDto.setStatusCd("0"); |
| | | List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMO.queryRepairUsers(repairUserDto); |
| | | Assert.listOnlyOne(repairUserDtos, "当前用户没有需要处理订单"); |
| | | //获取状态 |
| | | String state = repairUserDtos.get(0).getState(); |
| | | //获取报修id |
| | |
| | | repairDto.setRepairId(repairId); |
| | | repairDto.setStatusCd("0"); |
| | | List<RepairDto> repairDtos = repairInnerServiceSMO.queryRepairs(repairDto); |
| | | Assert.listOnlyOne(repairDtos, "不存在这条报修信息"); |
| | | //获取报修人姓名 |
| | | String repairName = repairDtos.get(0).getRepairName(); |
| | | //获取报修内容 |
| | |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityId(communityId); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMO.queryCommunitys(communityDto); |
| | | //获取报修类型 |
| | | String repairType = repairDtos.get(0).getRepairType(); |
| | | RepairSettingDto repairSettingDto = new RepairSettingDto(); |
| | | repairSettingDto.setSettingId(repairType); |
| | | List<RepairSettingDto> repairSettingDtos = repairSettingInnerServiceSMO.queryRepairSettings(repairSettingDto); |
| | | Assert.listOnlyOne(repairSettingDtos, "信息错误"); |
| | | JSONObject paramIn = new JSONObject(); |
| | | if (state.equals("10003")) { //退单状态 |
| | | //退单人 |
| | |
| | | Date endTime = repairUserDtos.get(0).getEndTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String time = format.format(endTime); |
| | | //获取价格 |
| | | String price = ""; |
| | | for (Business bus : businesses) { |
| | | if (bus.getBusinessTypeCd().equals("600100030001")) { //保存费用信息 |
| | | JSONObject data = bus.getData(); |
| | | JSONArray jsonArray = data.getJSONArray("PayFeePo"); |
| | | JSONObject jsonObject = jsonArray.getJSONObject(0); |
| | | PayFeePo payFeePo = BeanConvertUtil.covertBean(jsonObject, PayFeePo.class); |
| | | price = payFeePo.getAmount(); |
| | | } |
| | | } |
| | | paramIn.put("repairName", repairName); |
| | | paramIn.put("repairObjName", repairObjName); |
| | | paramIn.put("context", context); |
| | |
| | | paramIn.put("time", time); |
| | | paramIn.put("repairObjId", repairObjId); |
| | | paramIn.put("preStaffId", preStaffId); |
| | | RepairUserDto repairUser = new RepairUserDto(); |
| | | repairUser.setRepairId(repairId); |
| | | repairUser.setState("10005"); |
| | | //查询报修用户记录 |
| | | List<RepairUserDto> repairUserDtoList = repairUserInnerServiceSMO.queryRepairUsers(repairUser); |
| | | //获取报修用户id |
| | | String staffId = repairUserDtoList.get(0).getStaffId(); |
| | | paramIn.put("userId", staffId); |
| | | publishReturnMsg(paramIn, communityDtos.get(0)); |
| | | if (!StringUtil.isEmpty(price)) { |
| | | paramIn.put("price", price); |
| | | paramIn.put("feeState", "未缴费"); |
| | | //获取付款方id |
| | | String roomId = repairDtos.get(0).getRepairObjId(); |
| | | //获取付款方名称 |
| | | String roomName = repairDtos.get(0).getRepairObjName(); |
| | | paramIn.put("roomId", roomId); |
| | | paramIn.put("roomName", roomName); |
| | | //生成费用给业主发送信息 |
| | | sendMessage(paramIn, communityDtos.get(0)); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | //获取用户id |
| | | String preStaffId = paramIn.getString("preStaffId"); |
| | | if (!StringUtil.isEmpty(preStaffId)) { |
| | | String staffId = paramIn.getString("userId"); |
| | | if (!StringUtil.isEmpty(staffId)) { |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setUserId(preStaffId); |
| | | ownerAppUserDto.setUserId(staffId); |
| | | ownerAppUserDto.setAppType("WECHAT"); |
| | | //查询绑定业主 |
| | | List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMO.queryOwnerAppUsers(ownerAppUserDto); |
| | | if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) { |
| | | //获取openId |
| | | String openId = ownerAppUserDtos.get(0).getOpenId(); |
| | | String url = sendMsgUrl + accessToken; |
| | | Data data = new Data(); |
| | | PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage(); |
| | | templateMessage.setTemplate_id(templateId); |
| | | templateMessage.setTouser(openId); |
| | | data.setFirst(new Content("尊敬的" + paramIn.getString("repairName") + "先生/女士,您的报修问题,已经为您处理完毕。")); |
| | | if (communityDto.getName().equals(paramIn.getString("repairObjName"))) { |
| | | data.setKeyword1(new Content(paramIn.getString("repairObjName"))); |
| | | } else { |
| | | data.setKeyword1(new Content(communityDto.getName() + paramIn.getString("repairObjName"))); |
| | | } |
| | | data.setKeyword2(new Content(paramIn.getString("context"))); |
| | | data.setKeyword3(new Content(paramIn.getString("staffName"))); |
| | | data.setKeyword4(new Content(paramIn.getString("time"))); |
| | | data.setRemark(new Content("请点击查看详情,对我们的工作进行评价,以便提供更优质的服务,感谢您的配合和使用,祝您生活愉快,阖家欢乐!")); |
| | | templateMessage.setData(data); |
| | | String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL"); |
| | | templateMessage.setUrl(wechatUrl); |
| | | logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage)); |
| | | ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class); |
| | | logger.info("微信模板返回内容:{}", responseEntity); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 结单生成费用给业主推送信息 |
| | | * |
| | | * @param paramIn |
| | | * @param communityDto |
| | | */ |
| | | private void sendMessage(JSONObject paramIn, CommunityDto communityDto) { |
| | | //查询公众号配置 |
| | | SmallWeChatDto smallWeChatDto = new SmallWeChatDto(); |
| | | smallWeChatDto.setWeChatType("1100"); |
| | | smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY); |
| | | smallWeChatDto.setObjId(communityDto.getCommunityId()); |
| | | List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto); |
| | | if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) { |
| | | logger.info("未配置微信公众号信息,定时任务执行结束"); |
| | | return; |
| | | } |
| | | SmallWeChatDto weChatDto = smallWeChatDtos.get(0); |
| | | SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto(); |
| | | smallWechatAttrDto.setCommunityId(communityDto.getCommunityId()); |
| | | smallWechatAttrDto.setWechatId(weChatDto.getWeChatId()); |
| | | smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_REPAIR_CHARGE_SCENE_TEMPLATE); |
| | | List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto); |
| | | if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) { |
| | | logger.info("未配置微信公众号消息模板"); |
| | | return; |
| | | } |
| | | String templateId = smallWechatAttrDtos.get(0).getValue(); |
| | | String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret()); |
| | | if (StringUtil.isEmpty(accessToken)) { |
| | | logger.info("推送微信模板,获取accessToken失败:{}", accessToken); |
| | | return; |
| | | } |
| | | //获取房屋所属业主 |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setRoomId(paramIn.getString("roomId")); |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMO.queryOwnerRoomRels(ownerRoomRelDto); |
| | | Assert.listOnlyOne(ownerRoomRelDtos, "当前房屋没有所属业主"); |
| | | //获取业主id |
| | | String ownerId = ownerRoomRelDtos.get(0).getOwnerId(); |
| | | //查询绑定业主 |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setMemberId(ownerId); |
| | | ownerAppUserDto.setAppType("WECHAT"); |
| | | List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMO.queryOwnerAppUsers(ownerAppUserDto); |
| | | if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) { |
| | | //获取openId |
| | | String openId = ownerAppUserDtos.get(0).getOpenId(); |
| | | String url = sendMsgUrl + accessToken; |
| | |
| | | PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage(); |
| | | templateMessage.setTemplate_id(templateId); |
| | | templateMessage.setTouser(openId); |
| | | data.setFirst(new Content("尊敬的" + paramIn.getString("repairName") + "先生/女士,您的报修问题,已经为您处理完毕。")); |
| | | if (communityDto.getName().equals(paramIn.getString("repairObjName"))) { |
| | | data.setKeyword1(new Content(paramIn.getString("repairObjName"))); |
| | | } else { |
| | | data.setKeyword1(new Content(communityDto.getName() + paramIn.getString("repairObjName"))); |
| | | } |
| | | data.setKeyword2(new Content(paramIn.getString("context"))); |
| | | data.setKeyword3(new Content(paramIn.getString("staffName"))); |
| | | data.setKeyword4(new Content(paramIn.getString("time"))); |
| | | data.setRemark(new Content("请点击查看详情,对我们的工作进行评价,以便提供更优质的服务,感谢您的配合和使用,祝您生活愉快,阖家欢乐!")); |
| | | data.setFirst(new Content(paramIn.getString("roomName") + "缴费信息如下:")); |
| | | data.setKeyword1(new Content(paramIn.getString("roomName"))); |
| | | data.setKeyword2(new Content(paramIn.getString("repairName"))); |
| | | data.setKeyword3(new Content("维修费")); |
| | | data.setKeyword4(new Content(paramIn.getString("feeState"))); |
| | | data.setKeyword5(new Content(paramIn.getString("price") + "元")); |
| | | data.setRemark(new Content("请您及时缴费,感谢您的配合和使用,祝您生活愉快,阖家欢乐!")); |
| | | templateMessage.setData(data); |
| | | String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL"); |
| | | templateMessage.setUrl(wechatUrl); |
| | |
| | | feeDto.setFeeId(payFeeDetailPo.getFeeId()); |
| | | feeDto.setCommunityId(payFeeDetailPo.getCommunityId()); |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | Assert.listOnlyOne(feeDtos, "未查询到费用信息"); |
| | | //获取费用类型 |
| | | String feeTypeCdName = feeDtos.get(0).getFeeTypeCdName(); |
| | |
| | | String endTime = DateUtil.dateTimeToDate(payFeeDetailPo.getEndTime()); |
| | | //获取用户缴费金额 |
| | | String receivedAmount = payFeeDetailPo.getReceivedAmount(); |
| | | //获取费用类型 |
| | | String feeTypeCd = feeDtos.get(0).getFeeTypeCd(); |
| | | //获取社区名称 |
| | | String name = communityDtos.get(0).getName(); |
| | | JSONObject paramIn = new JSONObject(); |
| | |
| | | paramIn.put("receivedAmount", receivedAmount); |
| | | paramIn.put("startTime", startTime); |
| | | paramIn.put("endTime", endTime); |
| | | //给业主推送消息 |
| | | sendMessage(paramIn, communityDtos.get(0), payFeeDetailPo); |
| | | publishMsg(paramIn, communityDtos.get(0), payFeeDetailPo); |
| | | if (feeTypeCd.equals("888800010012")) { |
| | | //给处理报修完结单的维修师傅推送消息 |
| | | sendMsg(paramIn, communityDtos.get(0), payFeeDetailPo); |
| | | } else { |
| | | //给员工推送消息 |
| | | publishMsg(paramIn, communityDtos.get(0), payFeeDetailPo); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 给完结订单的维修师傅推送信息 |
| | | * |
| | | * @param paramIn |
| | | * @param communityDto |
| | | * @param payFeeDetailPo |
| | | */ |
| | | private void sendMsg(JSONObject paramIn, CommunityDto communityDto, PayFeeDetailPo payFeeDetailPo) { |
| | | //查询公众号配置 |
| | | SmallWeChatDto smallWeChatDto = new SmallWeChatDto(); |
| | | smallWeChatDto.setWeChatType("1100"); |
| | | smallWeChatDto.setObjType(SmallWeChatDto.OBJ_TYPE_COMMUNITY); |
| | | smallWeChatDto.setObjId(communityDto.getCommunityId()); |
| | | List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto); |
| | | if (smallWeChatDto == null || smallWeChatDtos.size() <= 0) { |
| | | logger.info("未配置微信公众号信息,定时任务执行结束"); |
| | | return; |
| | | } |
| | | SmallWeChatDto weChatDto = smallWeChatDtos.get(0); |
| | | SmallWechatAttrDto smallWechatAttrDto = new SmallWechatAttrDto(); |
| | | smallWechatAttrDto.setCommunityId(communityDto.getCommunityId()); |
| | | smallWechatAttrDto.setWechatId(weChatDto.getWeChatId()); |
| | | smallWechatAttrDto.setSpecCd(SmallWechatAttrDto.SPEC_CD_WECHAT_SUCCESS_TEMPLATE); |
| | | List<SmallWechatAttrDto> smallWechatAttrDtos = smallWechatAttrInnerServiceSMOImpl.querySmallWechatAttrs(smallWechatAttrDto); |
| | | if (smallWechatAttrDtos == null || smallWechatAttrDtos.size() <= 0) { |
| | | logger.info("未配置微信公众号消息模板"); |
| | | return; |
| | | } |
| | | String templateId = smallWechatAttrDtos.get(0).getValue(); |
| | | String accessToken = WechatFactory.getAccessToken(weChatDto.getAppId(), weChatDto.getAppSecret()); |
| | | if (StringUtil.isEmpty(accessToken)) { |
| | | logger.info("推送微信模板,获取accessToken失败:{}", accessToken); |
| | | return; |
| | | } |
| | | FeeDto feeDto = new FeeDto(); |
| | | feeDto.setFeeId(payFeeDetailPo.getFeeId()); |
| | | feeDto.setCommunityId(payFeeDetailPo.getCommunityId()); |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | Assert.listOnlyOne(feeDtos, "费用不存在"); |
| | | //获取创建用户,即处理结单的维修维修师傅 |
| | | String userId = feeDtos.get(0).getUserId(); |
| | | String url = sendMsgUrl + accessToken; |
| | | //根据 userId 查询到openId |
| | | try { |
| | | StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto(); |
| | | staffAppAuthDto.setStaffId(userId); |
| | | staffAppAuthDto.setAppType("WECHAT"); |
| | | List<StaffAppAuthDto> staffAppAuthDtos = staffAppAuthInnerServiceSMO.queryStaffAppAuths(staffAppAuthDto); |
| | | Assert.listOnlyOne(staffAppAuthDtos, "员工未认证"); |
| | | String openId = staffAppAuthDtos.get(0).getOpenId(); |
| | | Data data = new Data(); |
| | | PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage(); |
| | | templateMessage.setTemplate_id(templateId); |
| | | templateMessage.setTouser(openId); |
| | | data.setFirst(new Content("业主已缴纳维修费,信息如下:")); |
| | | data.setKeyword1(new Content(paramIn.getString("payFeeRoom"))); |
| | | data.setKeyword2(new Content(paramIn.getString("feeTypeCdName"))); |
| | | data.setKeyword3(new Content(paramIn.getString("payFeeTime"))); |
| | | data.setKeyword4(new Content(paramIn.getString("receivedAmount") + "元")); |
| | | data.setRemark(new Content("请与客服管家核实费用")); |
| | | templateMessage.setData(data); |
| | | String wechatUrl = MappingCache.getValue("OWNER_WECHAT_URL"); |
| | | templateMessage.setUrl(wechatUrl); |
| | | logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage)); |
| | | ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class); |
| | | logger.info("微信模板返回内容:{}", responseEntity); |
| | | } catch (Exception e) { |
| | | logger.error("发送缴费信息失败", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 给业主推送消息 |
| | | * |
| | | * @param paramIn |
| | |
| | | import com.java110.dto.roomRenovationDetail.RoomRenovationDetailDto; |
| | | import com.java110.dto.smallWeChat.SmallWeChatDto; |
| | | import com.java110.dto.smallWechatAttr.SmallWechatAttrDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | import com.java110.entity.order.Business; |
| | | import com.java110.entity.wechat.Content; |
| | | import com.java110.entity.wechat.Data; |
| | |
| | | import com.java110.intf.community.IRoomRenovationDetailInnerServiceSMO; |
| | | import com.java110.intf.store.ISmallWeChatInnerServiceSMO; |
| | | import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO; |
| | | import com.java110.intf.store.IStoreInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerAppUserInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; |
| | |
| | | |
| | | @Autowired |
| | | private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private IStoreInnerServiceSMO storeInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private RestTemplate outRestTemplate; |
| | |
| | | ownerAppUserDto.setAppType("WECHAT"); |
| | | //查询绑定业主 |
| | | List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMO.queryOwnerAppUsers(ownerAppUserDto); |
| | | //获取当前用户id |
| | | String userId = paramIn.getString("userId"); |
| | | StoreUserDto storeUserDto = new StoreUserDto(); |
| | | storeUserDto.setUserId(userId); |
| | | //查询商户员工信息 |
| | | List<StoreUserDto> storeUsers = storeInnerServiceSMO.getStoreUserInfo(storeUserDto); |
| | | //查询当前绑定业主所属小区 |
| | | String communityId = ownerAppUserDtos.get(0).getCommunityId(); |
| | | //通过小区id查询小区信息 |
| | | CommunityDto community = new CommunityDto(); |
| | | community.setCommunityId(communityId); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMO.queryCommunitys(community); |
| | | //获取商户手机号 |
| | | String tel = null; |
| | | if (storeUsers != null && storeUsers.size() > 0) { |
| | | tel = storeUsers.get(0).getTel(); |
| | | if (communityDtos != null && communityDtos.size() > 0) { |
| | | tel = communityDtos.get(0).getTel(); |
| | | } |
| | | String[] roomNames = paramIn.getString("roomName").split("-"); |
| | | if (ownerAppUserDtos.size() > 0) { |
| | |
| | | logger.info("微信模板返回内容:{}", responseEntity); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.java110.dto.roomRenovation.RoomRenovationDto; |
| | | import com.java110.dto.smallWeChat.SmallWeChatDto; |
| | | import com.java110.dto.smallWechatAttr.SmallWechatAttrDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | import com.java110.entity.order.Business; |
| | | import com.java110.entity.wechat.Content; |
| | | import com.java110.entity.wechat.Data; |
| | |
| | | import com.java110.intf.community.ICommunityInnerServiceSMO; |
| | | import com.java110.intf.store.ISmallWeChatInnerServiceSMO; |
| | | import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO; |
| | | import com.java110.intf.store.IStoreInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerAppUserInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; |
| | |
| | | |
| | | @Autowired |
| | | private IOwnerAppUserInnerServiceSMO ownerAppUserInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private IStoreInnerServiceSMO storeInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private RestTemplate outRestTemplate; |
| | |
| | | ownerAppUserDto.setAppType("WECHAT"); |
| | | //查询绑定业主 |
| | | List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMO.queryOwnerAppUsers(ownerAppUserDto); |
| | | //获取当前用户id |
| | | String userId = paramIn.getString("userId"); |
| | | StoreUserDto storeUserDto = new StoreUserDto(); |
| | | storeUserDto.setUserId(userId); |
| | | //查询商户员工信息 |
| | | List<StoreUserDto> storeUsers = storeInnerServiceSMO.getStoreUserInfo(storeUserDto); |
| | | //获取商户手机号 |
| | | //查询当前绑定业主所属小区 |
| | | String communityId = ownerAppUserDtos.get(0).getCommunityId(); |
| | | //通过小区id查询小区信息 |
| | | CommunityDto community = new CommunityDto(); |
| | | community.setCommunityId(communityId); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMO.queryCommunitys(community); |
| | | //获取物业联系方式 |
| | | String tel = null; |
| | | if (storeUsers != null && storeUsers.size() > 0) { |
| | | tel = storeUsers.get(0).getTel(); |
| | | if (communityDtos != null && communityDtos.size() > 0) { |
| | | tel = communityDtos.get(0).getTel(); |
| | | } |
| | | String[] roomNames = paramIn.getString("roomName").split("-"); |
| | | //获取状态 |
| | |
| | | logger.info("微信模板返回内容:{}", responseEntity); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.java110.dto.smallWeChat.SmallWeChatDto; |
| | | import com.java110.dto.smallWechatAttr.SmallWechatAttrDto; |
| | | import com.java110.dto.staffAppAuth.StaffAppAuthDto; |
| | | import com.java110.dto.store.StoreUserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.entity.order.Business; |
| | | import com.java110.entity.wechat.Content; |
| | |
| | | |
| | | @Autowired |
| | | private IRoomRenovationsInnerServiceSMO roomRenovationsInnerServiceSMO; |
| | | |
| | | @Autowired |
| | | private IStoreInnerServiceSMO storeInnerServiceSMO; |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(MachineSaveRoomRenovation.class); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 给业主自己推送消息 |
| | | * |
| | | * @param paramIn |
| | | * @param communityDto |
| | | */ |
| | |
| | | RoomRenovationDto roomRenovationDto = new RoomRenovationDto(); |
| | | roomRenovationDto.setRoomId(roomId); |
| | | List<RoomRenovationDto> roomRenovationDtos = roomRenovationsInnerServiceSMO.queryRoomRenovations(roomRenovationDto); |
| | | //获取当前用户id |
| | | String userId = paramIn.getString("userId"); |
| | | StoreUserDto storeUserDto = new StoreUserDto(); |
| | | storeUserDto.setUserId(userId); |
| | | //查询商户员工信息 |
| | | List<StoreUserDto> storeUsers = storeInnerServiceSMO.getStoreUserInfo(storeUserDto); |
| | | //获取商户手机号 |
| | | //查询当前绑定业主所属小区 |
| | | String communityId = ownerAppUserDtos.get(0).getCommunityId(); |
| | | //通过小区id查询小区信息 |
| | | CommunityDto community = new CommunityDto(); |
| | | community.setCommunityId(communityId); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMO.queryCommunitys(community); |
| | | //获取物业联系方式 |
| | | String tel = null; |
| | | if (storeUsers != null && storeUsers.size() > 0) { |
| | | tel = storeUsers.get(0).getTel(); |
| | | if (communityDtos != null && communityDtos.size() > 0) { |
| | | tel = communityDtos.get(0).getTel(); |
| | | } |
| | | String[] roomName = paramIn.getString("roomName").split("-"); |
| | | if (ownerAppUserDtos.size() > 0) { |
| | |
| | | @Override |
| | | protected void process(TaskDto taskDto) { |
| | | logger.debug("开始执行微信模板信息推送" + taskDto.toString()); |
| | | |
| | | // 获取小区 |
| | | List<CommunityDto> communityDtos = getAllCommunity(); |
| | | |
| | | for (CommunityDto communityDto : communityDtos) { |
| | | try { |
| | | returnVisitRepair(taskDto, communityDto); |
| | |
| | | repairDto.setRow(100); |
| | | //查询需要程序轮训派单 订单 |
| | | List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto); |
| | | |
| | | for (RepairDto tmpRepairDto : repairDtos) { |
| | | |
| | | doReturnVisitRepair(tmpRepairDto); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param tmpRepairDto |
| | | */ |
| | | private void doReturnVisitRepair(RepairDto tmpRepairDto) { |
| | | |
| | | if ("001".equals(tmpRepairDto.getReturnVisitFlag())) { |
| | | RepairPoolPo repairPoolPo = new RepairPoolPo(); |
| | | repairPoolPo.setRepairId(tmpRepairDto.getRepairId()); |
| | |
| | | repairInnerServiceSMOImpl.updateRepair(repairPoolPo); |
| | | return; |
| | | } |
| | | |
| | | if ("002".equals(tmpRepairDto.getReturnVisitFlag()) && RepairDto.STATE_APPRAISE.equals(tmpRepairDto.getState())) { |
| | | RepairPoolPo repairPoolPo = new RepairPoolPo(); |
| | | repairPoolPo.setRepairId(tmpRepairDto.getRepairId()); |
| | |
| | | repairInnerServiceSMOImpl.updateRepair(repairPoolPo); |
| | | return; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.java110.store.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * 资源组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 资源服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * <p> |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IResourceStoreServiceDao { |
| | | |
| | | /** |
| | | * 保存 资源信息 |
| | | * |
| | | * @param businessResourceStoreInfo 资源信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessResourceStoreInfo(Map businessResourceStoreInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询资源信息(business过程) |
| | | * 根据bId 查询资源信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 资源信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessResourceStoreInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 资源信息 Business数据到 Instance中 |
| | | * |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveResourceStoreInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询资源信息(instance过程) |
| | | * 根据bId 查询资源信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 资源信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getResourceStoreInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改资源信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | int updateResourceStoreInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询资源总数 |
| | |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存资源信息 入参 businessResourceStoreInfo : {}", businessResourceStoreInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("resourceResourceStoreServiceDaoImpl.saveBusinessResourceStoreInfo", businessResourceStoreInfo); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存资源数据失败:" + JSONObject.toJSONString(businessResourceStoreInfo)); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessResourceStoreInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询资源信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessResourceStoreInfos = sqlSessionTemplate.selectList("resourceResourceStoreServiceDaoImpl.getBusinessResourceStoreInfo", info); |
| | | |
| | | return businessResourceStoreInfos; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void saveResourceStoreInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存资源信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("resourceResourceStoreServiceDaoImpl.saveResourceStoreInfoInstance", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存资源信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | |
| | | @Override |
| | | public List<Map> getResourceStoreInfo(Map info) throws DAOException { |
| | | logger.debug("查询资源信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessResourceStoreInfos = sqlSessionTemplate.selectList("resourceResourceStoreServiceDaoImpl.getResourceStoreInfo", info); |
| | | |
| | | return businessResourceStoreInfos; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public int updateResourceStoreInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改资源信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("resourceResourceStoreServiceDaoImpl.updateResourceStoreInfoInstance", info); |
| | | |
| | | return saveFlag; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public int queryResourceStoresCount(Map info) { |
| | | logger.debug("查询资源数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessResourceStoreInfos = sqlSessionTemplate.selectList("resourceResourceStoreServiceDaoImpl.queryResourceStoresCount", info); |
| | | if (businessResourceStoreInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessResourceStoreInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | businessResourceStoreInfo.put("storeId", businessResourceStoreInfo.get("store_id")); |
| | | businessResourceStoreInfo.put("stock", businessResourceStoreInfo.get("stock")); |
| | | businessResourceStoreInfo.put("resId", businessResourceStoreInfo.get("res_id")); |
| | | businessResourceStoreInfo.put("goodsType", businessResourceStoreInfo.get("goods_type")); |
| | | businessResourceStoreInfo.put("unitCode", businessResourceStoreInfo.get("unit_code")); |
| | | businessResourceStoreInfo.put("remark", businessResourceStoreInfo.get("remark")); |
| | | businessResourceStoreInfo.put("outLowPrice", businessResourceStoreInfo.get("out_low_price")); |
| | | businessResourceStoreInfo.put("outHighPrice", businessResourceStoreInfo.get("out_high_price")); |
| | | businessResourceStoreInfo.remove("bId"); |
| | | businessResourceStoreInfo.put("statusCd", statusCd); |
| | | } |
| | |
| | | currentResourceStoreInfo.put("storeId", currentResourceStoreInfo.get("store_id")); |
| | | currentResourceStoreInfo.put("stock", currentResourceStoreInfo.get("stock")); |
| | | currentResourceStoreInfo.put("resId", currentResourceStoreInfo.get("res_id")); |
| | | |
| | | |
| | | currentResourceStoreInfo.put("goodsType", currentResourceStoreInfo.get("goods_type")); |
| | | currentResourceStoreInfo.put("unitCode", currentResourceStoreInfo.get("unit_code")); |
| | | currentResourceStoreInfo.put("remark", currentResourceStoreInfo.get("remark")); |
| | | currentResourceStoreInfo.put("outLowPrice", currentResourceStoreInfo.get("out_low_price")); |
| | | currentResourceStoreInfo.put("outHighPrice", currentResourceStoreInfo.get("out_high_price")); |
| | | currentResourceStoreInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getResourceStoreServiceDaoImpl().saveBusinessResourceStoreInfo(currentResourceStoreInfo); |
| | | |
| | |
| | | package com.java110.store.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.resourceStore.ResourceStoreDto; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.store.IResourceStoreInnerServiceSMO; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.po.purchase.ResourceStorePo; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<ResourceStoreDto> queryResourceStores(@RequestBody ResourceStoreDto resourceResourceStoreDto) { |
| | | |
| | |
| | | } |
| | | |
| | | List<ResourceStoreDto> resourceResourceStores = BeanConvertUtil.covertBeanList(resourceResourceStoreServiceDaoImpl.getResourceStoreInfo(BeanConvertUtil.beanCovertMap(resourceResourceStoreDto)), ResourceStoreDto.class); |
| | | |
| | | return resourceResourceStores; |
| | | //获取图片地址 |
| | | List<ResourceStoreDto> resourceStoreDtos = new ArrayList<>(); |
| | | for (ResourceStoreDto resourceStoreDto : resourceResourceStores) { |
| | | //获取资源id |
| | | String resId = resourceStoreDto.getResId(); |
| | | FileRelDto fileRelDto = new FileRelDto(); |
| | | fileRelDto.setObjId(resId); |
| | | //查询文件表 |
| | | List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto); |
| | | if (fileRelDtos != null && fileRelDtos.size() > 0) { |
| | | List<String> fileUrls = new ArrayList<>(); |
| | | for (FileRelDto fileRel : fileRelDtos) { |
| | | String url = "/callComponent/download/getFile/file?fileId=" + fileRel.getFileRealName() + "&communityId=-1"; |
| | | fileUrls.add(url); |
| | | } |
| | | resourceStoreDto.setFileUrls(fileUrls); |
| | | } |
| | | resourceStoreDtos.add(resourceStoreDto); |
| | | } |
| | | return resourceStoreDtos; |
| | | } |
| | | |
| | | |
| | |
| | | DistributedLock.releaseDistributedLock(requestId, key); |
| | | } |
| | | } |
| | | |
| | | |
| | | public IResourceStoreServiceDao getResourceStoreServiceDaoImpl() { |
| | | return resourceResourceStoreServiceDaoImpl; |