1、优化报修增加报修设置类型,2、增加业主车辆批量导入3、优化相关bug
| | |
| | | private String currentUserId; |
| | | private String currentUserName; |
| | | private String currentUserTel; |
| | | private String startTime; |
| | | private String endTime; |
| | | |
| | | private String startUserId; |
| | | |
| | | // |
| | | private String auditCode; |
| | | |
| | | private String auditMessage; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getComplaintId() { |
| | | return complaintId; |
| | |
| | | public void setRoomId(String roomId) { |
| | | this.roomId = roomId; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | |
| | | public void setRoomIds(String[] roomIds) { |
| | | this.roomIds = roomIds; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | } |
| | |
| | | private String idCard; |
| | | private String link; |
| | | private String parkingType; |
| | | //停车场类型 |
| | | private String typeCd; |
| | | private String spaceSate; |
| | | |
| | | private String roomName; |
| | | |
| | |
| | | private String areaNum; |
| | | |
| | | private String num; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | |
| | | public void setCarTypeCds(String[] carTypeCds) { |
| | | this.carTypeCds = carTypeCds; |
| | | } |
| | | |
| | | public String getTypeCd() { |
| | | return typeCd; |
| | | } |
| | | |
| | | public void setTypeCd(String typeCd) { |
| | | this.typeCd = typeCd; |
| | | } |
| | | |
| | | public String getSpaceSate() { |
| | | return spaceSate; |
| | | } |
| | | |
| | | public void setSpaceSate(String spaceSate) { |
| | | this.spaceSate = spaceSate; |
| | | } |
| | | } |
| | |
| | | public static final String STATE_COMPLATE = "1900"; |
| | | //未处理主动结单 |
| | | public static final String STATE_UNPROCESSED = "2000"; |
| | | //暂停报修单 |
| | | public static final String STATE_STOP = "2001"; |
| | | |
| | | public static final String REPAIR_WAY_GRABBING = "100"; //抢单模式 |
| | | public static final String REPAIR_WAY_ASSIGN = "200"; //指派模式 |
| | |
| | | private String repairmanServiceScore; |
| | | //平均分 |
| | | private String average; |
| | | private String repairSettingType; |
| | | private String repairSettingTypeName; |
| | | |
| | | public String getRepairName() { |
| | | return repairName; |
| | |
| | | public void setPayType(String payType) { |
| | | this.payType = payType; |
| | | } |
| | | |
| | | public String getRepairSettingType() { |
| | | return repairSettingType; |
| | | } |
| | | |
| | | public void setRepairSettingType(String repairSettingType) { |
| | | this.repairSettingType = repairSettingType; |
| | | } |
| | | |
| | | public String getRepairSettingTypeName() { |
| | | return repairSettingTypeName; |
| | | } |
| | | |
| | | public void setRepairSettingTypeName(String repairSettingTypeName) { |
| | | this.repairSettingTypeName = repairSettingTypeName; |
| | | } |
| | | } |
| | |
| | | private String priceScope; |
| | | private String returnVisitFlag; |
| | | private String returnVisitFlagName; |
| | | private String repairSettingType; |
| | | private String repairSettingTypeName; |
| | | |
| | | |
| | | private Date createTime; |
| | |
| | | public void setReturnVisitFlagName(String returnVisitFlagName) { |
| | | this.returnVisitFlagName = returnVisitFlagName; |
| | | } |
| | | |
| | | public String getRepairSettingType() { |
| | | return repairSettingType; |
| | | } |
| | | |
| | | public void setRepairSettingType(String repairSettingType) { |
| | | this.repairSettingType = repairSettingType; |
| | | } |
| | | |
| | | public String getRepairSettingTypeName() { |
| | | return repairSettingTypeName; |
| | | } |
| | | |
| | | public void setRepairSettingTypeName(String repairSettingTypeName) { |
| | | this.repairSettingTypeName = repairSettingTypeName; |
| | | } |
| | | } |
| | |
| | | public static final String STATE_PAY_FEE = "10009";//待支付 |
| | | public static final String STATE_EVALUATE = "11000";//待评价 |
| | | public static final String STATE_FINISH_PAY_FEE = "12000";//已支付 |
| | | |
| | | public static final String STATE_STOP = "12001";//暂停 |
| | | |
| | | private String context; |
| | | private String repairId; |
| | |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class ResourceStoreUseRecordDto extends PageDto implements Serializable { |
| | | |
| | | private String repairId; |
| | | private String unitPrice; |
| | | private String createUserId; |
| | |
| | | private String endTime; |
| | | private String unitCodeName; |
| | | private String miniUnitCodeName; |
| | | //1001 报废回收 2002 工单损耗 3003 公用损耗 |
| | | private String state; |
| | | private String stateName; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | |
| | | public void setIsFixedName(String isFixedName) { |
| | | this.isFixedName = isFixedName; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getStateName() { |
| | | return stateName; |
| | | } |
| | | |
| | | public void setStateName(String stateName) { |
| | | this.stateName = stateName; |
| | | } |
| | | } |
| | |
| | | private String renovationCompany; |
| | | private String personMain; |
| | | private String personMainTel; |
| | | |
| | | private String renovationTime; |
| | | private String renovationStartTime; |
| | | private String renovationEndTime; |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | |
| | | this.personTel = personTel; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | |
| | | public void setPersonMainTel(String personMainTel) { |
| | | this.personMainTel = personMainTel; |
| | | } |
| | | |
| | | public String getRenovationTime() { |
| | | return renovationTime; |
| | | } |
| | | |
| | | public void setRenovationTime(String renovationTime) { |
| | | this.renovationTime = renovationTime; |
| | | } |
| | | |
| | | public String getRenovationStartTime() { |
| | | return renovationStartTime; |
| | | } |
| | | |
| | | public void setRenovationStartTime(String renovationStartTime) { |
| | | this.renovationStartTime = renovationStartTime; |
| | | } |
| | | |
| | | public String getRenovationEndTime() { |
| | | return renovationEndTime; |
| | | } |
| | | |
| | | public void setRenovationEndTime(String renovationEndTime) { |
| | | this.renovationEndTime = renovationEndTime; |
| | | } |
| | | } |
| | |
| | | private String payFeeFlag; |
| | | private String priceScope; |
| | | private String returnVisitFlag; |
| | | private String repairSettingType; |
| | | |
| | | |
| | | public String getRepairTypeName() { |
| | |
| | | public void setReturnVisitFlag(String returnVisitFlag) { |
| | | this.returnVisitFlag = returnVisitFlag; |
| | | } |
| | | |
| | | public String getRepairSettingType() { |
| | | return repairSettingType; |
| | | } |
| | | |
| | | public void setRepairSettingType(String repairSettingType) { |
| | | this.repairSettingType = repairSettingType; |
| | | } |
| | | } |
| | |
| | | package com.java110.po.resourceStoreUseRecord; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class ResourceStoreUseRecordPo implements Serializable { |
| | | |
| | |
| | | private String communityId; |
| | | private String resName; |
| | | private String resourceStoreName; |
| | | //1001 报废回收 2002 工单损耗 3003 公用损耗 |
| | | private String state; |
| | | |
| | | public String getRepairId() { |
| | | return repairId; |
| | |
| | | public void setResourceStoreName(String resourceStoreName) { |
| | | this.resourceStoreName = resourceStoreName; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | } |
| | |
| | | private String unitNum; |
| | | private String floorNum; |
| | | private String communityId; |
| | | // |
| | | |
| | | private String auditCode; |
| | | |
| | | private List<PhotoVo> photos; |
| | |
| | | <if test="roomId !=null and roomId != ''"> |
| | | and t.room_id= #{roomId} |
| | | </if> |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and fl.floor_id= #{floorId} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and bu.unit_id= #{unitId} |
| | | </if> |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | |
| | | <if test="roomId !=null and roomId != ''"> |
| | | and t.room_id= #{roomId} |
| | | </if> |
| | | <if test="floorId !=null and floorId != ''"> |
| | | and fl.floor_id= #{floorId} |
| | | </if> |
| | | <if test="unitId !=null and unitId != ''"> |
| | | and bu.unit_id= #{unitId} |
| | | </if> |
| | | <if test="roomNum !=null and roomNum != ''"> |
| | | and br.room_num= #{roomNum} |
| | | </if> |
| | |
| | | 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,rrv.visit_type visitType,rrv.context visitContext,a.appraise_score |
| | | appraiseScore, a.door_speed_score doorSpeedScore,a.repairman_service_score repairmanServiceScore, |
| | | t.pay_type,t.pay_type payType |
| | | t.pay_type,t.pay_type payType,rs.repair_setting_type repairSettingType,d1.name repairSettingTypeName |
| | | <if test="staffId != null and staffId != ''"> |
| | | ,rru.state repairDispatchState,rru.context repairDispatchContext,td.name repairDispatchStateName |
| | | </if> |
| | | 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_return_visit rrv on t.repair_id = rrv.repair_id and rrv.community_id = t.community_id and |
| | | rrv.status_cd = '0' |
| | | left join t_dict d1 on rs.repair_setting_type = d1.status_cd and d1.table_name = 'r_repair_setting' and d1.table_columns = 'repair_setting_type' |
| | | left join r_repair_return_visit rrv on t.repair_id = rrv.repair_id and rrv.community_id = t.community_id and rrv.status_cd = '0' |
| | | left join appraise a on a.obj_id = t.repair_id and a.status_cd = '0' |
| | | <if test="staffId != null and staffId != ''"> |
| | | ,r_repair_user rru |
| | |
| | | </if> |
| | | <if test="repairWay !=null and repairWay != ''"> |
| | | and rs.repair_way= #{repairWay} |
| | | </if> |
| | | <if test="repairSettingType !=null and repairSettingType != ''"> |
| | | and rs.repair_setting_type= #{repairSettingType} |
| | | </if> |
| | | <if test="returnVisitFlag != null and returnVisitFlag != '' and returnVisitFlag != '003'"> |
| | | and rs.return_visit_flag in ('001','002') |
| | |
| | | <if test="repairType !=null and repairType != ''"> |
| | | and t.repair_type= #{repairType} |
| | | </if> |
| | | <if test="repairSettingType !=null and repairSettingType != ''"> |
| | | and rs.repair_setting_type= #{repairSettingType} |
| | | </if> |
| | | <if test="payType !=null and payType != ''"> |
| | | and t.pay_type= #{payType} |
| | | </if> |
| | |
| | | td.table_columns='return_visit_flag' |
| | | where 1 =1 |
| | | and ru.state in ('10001','10009','11000') |
| | | and t.state in('1000','1100','1200','1300','1400','1700','1800') |
| | | and t.state in('1000','1100','1200','1300','1400','1700','1800','2001') |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and ru.staff_id = #{staffId} |
| | | </if> |
| | |
| | | td.table_columns='return_visit_flag' |
| | | where 1 =1 |
| | | and ru.state in ('10001','10009','11000') |
| | | and t.state in('1000','1100','1200','1300','1400','1700','1800') |
| | | and t.state in('1000','1100','1200','1300','1400','1700','1800','2001') |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and ru.staff_id = #{staffId} |
| | | </if> |
| | |
| | | <!-- 保存报修设置信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessRepairSettingInfo" parameterType="Map"> |
| | | insert into business_repair_setting( |
| | | operate,repair_type_name,repair_type,remark,b_id,community_id,repair_way,setting_id,public_area,pay_fee_flag,price_scope,return_visit_flag |
| | | operate,repair_type_name,repair_type,repair_setting_type,remark,b_id,community_id,repair_way,setting_id,public_area,pay_fee_flag,price_scope,return_visit_flag |
| | | ) values ( |
| | | #{operate},#{repairTypeName},#{repairType},#{remark},#{bId},#{communityId},#{repairWay},#{settingId},#{publicArea},#{payFeeFlag},#{priceScope},#{returnVisitFlag} |
| | | #{operate},#{repairTypeName},#{repairType},#{repairSettingType},#{remark},#{bId},#{communityId},#{repairWay},#{settingId},#{publicArea},#{payFeeFlag},#{priceScope},#{returnVisitFlag} |
| | | ) |
| | | </insert> |
| | | |
| | | <!-- 查询报修设置信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessRepairSettingInfo" parameterType="Map" resultType="Map"> |
| | | select t.operate,t.repair_type_name,t.repair_type_name repairTypeName,t.repair_type,t.repair_type |
| | | repairType,t.remark,t.b_id,t.b_id bId,t.community_id,t.community_id communityId,t.repair_way,t.repair_way |
| | | repairType,t.repair_setting_type,t.repair_setting_type repairSettingType,t.remark,t.b_id,t.b_id bId,t.community_id,t.community_id communityId,t.repair_way,t.repair_way |
| | | repairWay,t.setting_id,t.setting_id settingId,t.public_area,t.public_area |
| | | publicArea,t.pay_fee_flag,t.pay_fee_flag payFeeFlag |
| | | ,t.price_scope,t.price_scope priceScope,t.return_visit_flag,t.return_visit_flag returnVisitFlag |
| | |
| | | </if> |
| | | <if test="repairType !=null and repairType != ''"> |
| | | and t.repair_type= #{repairType} |
| | | </if> |
| | | <if test="repairSettingType !=null and repairSettingType != ''"> |
| | | and t.repair_setting_type= #{repairSettingType} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | |
| | | <!-- 保存报修设置信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveRepairSettingInfoInstance" parameterType="Map"> |
| | | insert into r_repair_setting( |
| | | repair_type_name,repair_type,remark,status_cd,b_id,community_id,repair_way,setting_id,public_area,pay_fee_flag,price_scope,return_visit_flag |
| | | ) select t.repair_type_name,t.repair_type,t.remark,'0',t.b_id,t.community_id,t.repair_way,t.setting_id |
| | | repair_type_name,repair_type,repair_setting_type,remark,status_cd,b_id,community_id,repair_way,setting_id,public_area,pay_fee_flag,price_scope,return_visit_flag |
| | | ) select t.repair_type_name,t.repair_type,t.repair_setting_type,t.remark,'0',t.b_id,t.community_id,t.repair_way,t.setting_id |
| | | ,t.public_area,t.pay_fee_flag,t.price_scope,t.return_visit_flag |
| | | from |
| | | business_repair_setting t where 1=1 |
| | |
| | | </if> |
| | | <if test="repairType !=null and repairType != ''"> |
| | | and t.repair_type= #{repairType} |
| | | </if> |
| | | <if test="repairSettingType and repairSettingType != ''"> |
| | | and t.repair_setting_type= #{repairSettingType} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | |
| | | <!-- 查询报修设置信息 add by wuxw 2018-07-03 --> |
| | | <select id="getRepairSettingInfo" parameterType="Map" resultType="Map"> |
| | | select t.repair_type_name,t.repair_type_name repairTypeName,t.repair_type,t.repair_type |
| | | repairType,t.remark,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.community_id,t.community_id |
| | | repairType,t.repair_setting_type,t.repair_setting_type repairSettingType,t.remark,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.community_id,t.community_id |
| | | communityId,t.repair_way,t.repair_way repairWay,t.setting_id,t.setting_id settingId,t.create_time |
| | | createTime,d.name repairWayName, |
| | | createTime,d.name repairWayName,d2.name repairSettingTypeName, |
| | | t.public_area,t.public_area publicArea,t.pay_fee_flag,t.pay_fee_flag payFeeFlag |
| | | ,t.price_scope,t.price_scope priceScope,t.return_visit_flag,t.return_visit_flag returnVisitFlag,d1.name |
| | | returnVisitFlagName |
| | | from r_repair_setting t |
| | | left join t_dict d on t.repair_way = d.status_cd and d.table_name = 'r_repair_setting' and d.table_columns = |
| | | 'repair_way' |
| | | left join t_dict d1 on t.return_visit_flag = d1.status_cd and d1.table_name = 'r_repair_setting' and |
| | | d1.table_columns = 'return_visit_flag' |
| | | left join t_dict d on t.repair_way = d.status_cd and d.table_name = 'r_repair_setting' and d.table_columns ='repair_way' |
| | | left join t_dict d1 on t.return_visit_flag = d1.status_cd and d1.table_name = 'r_repair_setting' and d1.table_columns = 'return_visit_flag' |
| | | left join t_dict d2 on t.repair_setting_type = d2.status_cd and d2.table_name = 'r_repair_setting' and d2.table_columns = 'repair_setting_type' |
| | | where 1 =1 |
| | | <if test="repairTypeName !=null and repairTypeName != ''"> |
| | | and t.repair_type_name like '%${repairTypeName}%' |
| | | </if> |
| | | <if test="repairType !=null and repairType != ''"> |
| | | and t.repair_type= #{repairType} |
| | | </if> |
| | | <if test="repairSettingType !=null and repairSettingType != ''"> |
| | | and t.repair_setting_type= #{repairSettingType} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | |
| | | <if test="repairType !=null and repairType != ''"> |
| | | , t.repair_type= #{repairType} |
| | | </if> |
| | | <if test="repairSettingType !=null and repairSettingType != ''"> |
| | | , t.repair_setting_type= #{repairSettingType} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | , t.remark= #{remark} |
| | | </if> |
| | |
| | | <select id="queryRepairSettingsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from r_repair_setting t |
| | | left join t_dict d on t.repair_way = d.status_cd and d.table_name = 'r_repair_setting' and d.table_columns = |
| | | 'repair_way' |
| | | left join t_dict d on t.repair_way = d.status_cd and d.table_name = 'r_repair_setting' and d.table_columns = 'repair_way' |
| | | where 1 =1 |
| | | <if test="repairTypeName !=null and repairTypeName != ''"> |
| | | and t.repair_type_name like '%${repairTypeName}%' |
| | |
| | | <if test="repairType !=null and repairType != ''"> |
| | | and t.repair_type= #{repairType} |
| | | </if> |
| | | <if test="repairSettingType !=null and repairSettingType != ''"> |
| | | and t.repair_setting_type= #{repairSettingType} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | |
| | | |
| | | <!-- 保存装修申请信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveRoomRenovationInfo" parameterType="Map"> |
| | | insert into room_renovation( |
| | | remark,is_violation,r_id,room_id,room_name,person_name,violation_desc,start_time,end_time,state,community_id,person_tel,is_postpone,postpone_time,renovation_company,person_main,person_main_tel |
| | | ) values ( |
| | | #{remark},#{isViolation},#{rId},#{roomId},#{roomName},#{personName},#{violationDesc},#{startTime},#{endTime},#{state},#{communityId},#{personTel},#{isPostpone},#{postponeTime},#{renovationCompany},#{personMain},#{personMainTel} |
| | | ) |
| | | insert into room_renovation(remark, is_violation, r_id, room_id, room_name, person_name, violation_desc, |
| | | start_time, end_time, state, community_id, person_tel, is_postpone, postpone_time, |
| | | renovation_company, person_main, person_main_tel) |
| | | values (#{remark}, #{isViolation}, #{rId}, #{roomId}, #{roomName}, #{personName}, #{violationDesc}, |
| | | #{startTime}, #{endTime}, #{state}, #{communityId}, #{personTel}, #{isPostpone}, #{postponeTime}, |
| | | #{renovationCompany}, #{personMain}, #{personMainTel}) |
| | | </insert> |
| | | |
| | | <!-- 查询装修申请信息 add by wuxw 2018-07-03 --> |
| | |
| | | rId,t.room_id,t.room_id roomId,t.room_name,t.room_name roomName,t.person_name,t.person_name |
| | | personName,t.violation_desc,t.violation_desc violationDesc,t.start_time,t.start_time |
| | | startTime,t.end_time,t.end_time endTime,t.state,td.name stateName,t.community_id,t.community_id |
| | | communityId,t.person_tel,t.person_tel personTel,t.create_time createTime,t.is_postpone,t.is_postpone isPostpone,t.postpone_time,t.postpone_time postponeTime, |
| | | t.renovation_company,t.renovation_company renovationCompany,t.person_main,t.person_main personMain,t.person_main_tel,t.person_main_tel personMainTel |
| | | communityId,t.person_tel,t.person_tel personTel,t.create_time createTime,t.is_postpone,t.is_postpone |
| | | isPostpone,t.postpone_time,t.postpone_time postponeTime, |
| | | t.renovation_company,t.renovation_company renovationCompany,t.person_main,t.person_main |
| | | personMain,t.person_main_tel,t.person_main_tel personMainTel |
| | | from room_renovation t |
| | | left join t_dict td on td.table_name='room_renovation' and td.table_columns='state' |
| | | and t.state=td.status_cd |
| | |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="renovationTime !=null and renovationTime != ''"> |
| | | and t.start_time <= #{renovationTime} |
| | | and t.end_time >= #{renovationTime} |
| | | </if> |
| | | <if test="renovationStartTime !=null and renovationStartTime != ''"> |
| | | and t.create_time >= #{renovationStartTime} |
| | | </if> |
| | | <if test="renovationEndTime !=null and renovationEndTime != ''"> |
| | | and t.create_time <= #{renovationEndTime} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="renovationTime !=null and renovationTime != ''"> |
| | | and t.start_time <= #{renovationTime} |
| | | and t.end_time >= #{renovationTime} |
| | | </if> |
| | | <if test="renovationStartTime !=null and renovationStartTime != ''"> |
| | | and t.create_time >= #{renovationStartTime} |
| | | </if> |
| | | <if test="renovationEndTime !=null and renovationEndTime != ''"> |
| | | and t.create_time <= #{renovationEndTime} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | |
| | | |
| | | <select id="queryRepairForStaff" parameterType="Map" resultType="Map"> |
| | | SELECT r.staff_id staffId,r.staff_name staffName,r.state FROM r_repair_user r |
| | | inner join u_user u on u.user_id = r.staff_id and u.status_cd = '0' |
| | | WHERE r.state!='10005' AND r.state!='10009' AND r.state!='11000' AND |
| | | r.state!='12000' AND r.state != '10007' AND r.status_cd = '0' AND |
| | | r.repair_event != 'payUser' AND r.repair_event != 'startUser' AND r.staff_id != '-1' |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="complaintServiceDaoImpl"> |
| | | |
| | | <!-- 保存投诉建议信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessComplaintInfo" parameterType="Map"> |
| | | insert into business_complaint( |
| | | operate,complaint_id,type_cd,context,complaint_name,tel,state,store_id,b_id,room_id,community_id,start_user_id |
| | | ) values ( |
| | | #{operate},#{complaintId},#{typeCd},#{context},#{complaintName},#{tel},#{state},#{storeId},#{bId},#{roomId},#{communityId}, |
| | | #{startUserId} |
| | | ) |
| | | insert into business_complaint(operate, complaint_id, type_cd, context, complaint_name, tel, state, store_id, |
| | | b_id, room_id, community_id, start_user_id) |
| | | values (#{operate}, #{complaintId}, #{typeCd}, #{context}, #{complaintName}, #{tel}, #{state}, #{storeId}, |
| | | #{bId}, #{roomId}, #{communityId}, |
| | | #{startUserId}) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询投诉建议信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessComplaintInfo" parameterType="Map" resultType="Map"> |
| | |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 保存投诉建议信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveComplaintInfoInstance" parameterType="Map"> |
| | |
| | | <if test="roomId !=null and roomId != ''"> |
| | | and t.room_id= #{roomId} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询投诉建议信息 add by wuxw 2018-07-03 --> |
| | | <select id="getComplaintInfo" parameterType="Map" resultType="Map"> |
| | |
| | | <if test="startUserId !=null and startUserId != ''"> |
| | | and t.start_user_id= #{startUserId} |
| | | </if> |
| | | |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </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="updateComplaintInfoInstance" parameterType="Map"> |
| | |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询投诉建议数量 add by wuxw 2018-07-03 --> |
| | |
| | | <if test="startUserId !=null and startUserId != ''"> |
| | | and t.start_user_id= #{startUserId} |
| | | </if> |
| | | |
| | | |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.create_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <!-- 保存物品使用记录信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessResourceStoreUseRecordInfo" parameterType="Map"> |
| | | insert into business_resource_store_use_record( |
| | | unit_price,create_user_id,quantity,rsur_id,repair_id,create_user_name,remark,store_id,res_id,resource_store_name,operate,b_id,community_id |
| | | ) values ( |
| | | #{unitPrice},#{createUserId},#{quantity},#{rsurId},#{repairId},#{createUserName},#{remark},#{storeId},#{resId},#{resourceStoreName},#{operate},#{bId},#{communityId} |
| | | ) |
| | | insert into business_resource_store_use_record(unit_price, create_user_id, quantity, rsur_id, repair_id, |
| | | create_user_name, remark, store_id, res_id, resource_store_name, |
| | | operate, b_id, community_id, state) |
| | | values (#{unitPrice}, #{createUserId}, #{quantity}, #{rsurId}, #{repairId}, #{createUserName}, #{remark}, |
| | | #{storeId}, #{resId}, #{resourceStoreName}, #{operate}, #{bId}, #{communityId}, #{state}) |
| | | </insert> |
| | | |
| | | <!-- 查询物品使用记录信息(Business) add by wuxw 2018-07-03 --> |
| | |
| | | createUserId,t.quantity,t.rsur_id,t.rsur_id rsurId,t.repair_id,t.repair_id |
| | | repairId,t.create_user_name,t.create_user_name createUserName,t.remark,t.store_id,t.store_id |
| | | storeId,t.res_id,t.res_id resId,t.resource_store_name,t.resource_store_name |
| | | resourceStoreName,t.operate,t.b_id,t.b_id bId,t.community_id,t.community_id communityId |
| | | resourceStoreName,t.operate,t.b_id,t.b_id bId,t.community_id,t.community_id communityId,t.state |
| | | from business_resource_store_use_record t |
| | | where 1 =1 |
| | | <if test="unitPrice !=null and unitPrice != ''"> |
| | |
| | | <if test="resourceStoreName !=null and resourceStoreName != ''"> |
| | | and t.resource_store_name= #{resourceStoreName} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | |
| | | <!-- 保存物品使用记录信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveResourceStoreUseRecordInfoInstance" parameterType="Map"> |
| | | insert into resource_store_use_record( |
| | | unit_price,create_user_id,quantity,rsur_id,repair_id,create_user_name,status_cd,remark,store_id,res_id,resource_store_name,b_id,community_id |
| | | unit_price,create_user_id,quantity,rsur_id,repair_id,create_user_name,status_cd,remark,store_id,res_id,resource_store_name,b_id,community_id,state |
| | | ) select |
| | | t.unit_price,t.create_user_id,t.quantity,t.rsur_id,t.repair_id,t.create_user_name,'0',t.remark,t.store_id,t.res_id,t.resource_store_name,t.b_id,t.community_id |
| | | t.unit_price,t.create_user_id,t.quantity,t.rsur_id,t.repair_id,t.create_user_name,'0',t.remark,t.store_id,t.res_id,t.resource_store_name,t.b_id,t.community_id,t.state |
| | | from business_resource_store_use_record t where 1=1 |
| | | <if test="unitPrice !=null and unitPrice != ''"> |
| | | and t.unit_price= #{unitPrice} |
| | |
| | | <if test="resId !=null and resId != ''"> |
| | | and t.res_id= #{resId} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="resourceStoreName !=null and resourceStoreName != ''"> |
| | | and t.resource_store_name= #{resourceStoreName} |
| | | </if> |
| | |
| | | resId,t.resource_store_name,t.resource_store_name resourceStoreName,rs.res_name resName, |
| | | t.b_id,t.b_id bId,t.community_id,t.community_id communityId,t.create_time createTime, rst.name |
| | | rstName,rst1.name parentRstName,rss.spec_name specName,td1.name unitCodeName,td2.name miniUnitCodeName, |
| | | rs.is_fixed isFixed,td3.name isFixedName |
| | | rs.is_fixed isFixed,td3.name isFixedName,t.state,td4.name stateName |
| | | from resource_store_use_record t |
| | | left join resource_store rs on rs.res_id = t.res_id |
| | | left join resource_store_type rst on rs.rst_id = rst.rst_id |
| | | left join resource_store_type rst1 on rs.parent_rst_id = rst1.rst_id |
| | | left join resource_store_specification rss on rs.rss_id = rss.rss_id |
| | | left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns = 'unit_code' |
| | | left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'unit_code' |
| | | left join t_dict td3 on rs.is_fixed = td3.status_cd and td3.table_name = 'resource_store' and td3.table_columns = 'is_fixed' |
| | | left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns |
| | | = 'unit_code' |
| | | left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and |
| | | td2.table_columns = 'unit_code' |
| | | left join t_dict td3 on rs.is_fixed = td3.status_cd and td3.table_name = 'resource_store' and td3.table_columns |
| | | = 'is_fixed' |
| | | left join t_dict td4 on t.state = td4.status_cd and td4.table_name = 'resource_store_use_record' and |
| | | td4.table_columns = 'state' |
| | | where 1 = 1 |
| | | <if test="unitPrice !=null and unitPrice != ''"> |
| | | and t.unit_price= #{unitPrice} |
| | |
| | | <if test="isFixed !=null and isFixed != ''"> |
| | | and rs.is_fixed= #{isFixed} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | |
| | | <if test="resId !=null and resId != ''"> |
| | | , t.res_id= #{resId} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | , t.state= #{state} |
| | | </if> |
| | | <if test="resourceStoreName !=null and resourceStoreName != ''"> |
| | | , t.resource_store_name= #{resourceStoreName} |
| | | </if> |
| | |
| | | left join resource_store rs on rs.res_id = t.res_id |
| | | left join resource_store_type rst on rs.rst_id = rst.rst_id |
| | | left join resource_store_specification rss on rs.rss_id = rss.rss_id |
| | | left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns = 'unit_code' |
| | | left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'unit_code' |
| | | where 1 =1 |
| | | left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns |
| | | = 'unit_code' |
| | | left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and |
| | | td2.table_columns = 'unit_code' |
| | | left join t_dict td3 on rs.is_fixed = td3.status_cd and td3.table_name = 'resource_store' and td3.table_columns |
| | | = 'is_fixed' |
| | | left join t_dict td4 on t.state = td4.status_cd and td4.table_name = 'resource_store_use_record' and |
| | | td4.table_columns = 'state' |
| | | where 1 = 1 |
| | | <if test="unitPrice !=null and unitPrice != ''"> |
| | | and t.unit_price= #{unitPrice} |
| | | </if> |
| | |
| | | <if test="isFixed !=null and isFixed != ''"> |
| | | and rs.is_fixed= #{isFixed} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and rs.state= #{state} |
| | | </if> |
| | | <if test="parentRstId !=null and parentRstId != ''"> |
| | | and rs.parent_rst_id= #{parentRstId} |
| | | </if> |
| | |
| | | |
| | | <!-- 保存车辆信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveOwnerCarInfo" parameterType="Map"> |
| | | insert into owner_car( |
| | | car_brand,car_num,ps_id,remark,owner_id,car_type_cd,user_id,car_id,car_color,car_type,start_time,end_time,state,community_id,member_id,b_id |
| | | ) values ( |
| | | #{carBrand},#{carNum},#{psId},#{remark},#{ownerId},#{carTypeCd},#{userId},#{carId},#{carColor},#{carType},#{startTime},#{endTime},#{state},#{communityId},#{memberId},'-1' |
| | | ) |
| | | insert into owner_car(car_brand, car_num, ps_id, remark, owner_id, car_type_cd, user_id, car_id, car_color, |
| | | car_type, start_time, end_time, state, community_id, member_id, b_id) |
| | | values (#{carBrand}, #{carNum}, #{psId}, #{remark}, #{ownerId}, #{carTypeCd}, #{userId}, #{carId}, #{carColor}, |
| | | #{carType}, #{startTime}, #{endTime}, #{state}, #{communityId}, #{memberId}, '-1') |
| | | </insert> |
| | | |
| | | |
| | |
| | | */ |
| | | public static final String BINDING_REPAIR_DISPATCH = "ownerRepair.repairDispatch"; |
| | | |
| | | /** |
| | | * 暂停报修单 |
| | | */ |
| | | public static final String BINDING_REPAIR_STOP = "ownerRepair.repairStop"; |
| | | |
| | | /** |
| | | * 启动报修单 |
| | | */ |
| | | public static final String BINDING_REPAIR_START = "ownerRepair.repairStart"; |
| | | |
| | | /** |
| | | * 报修结单 |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.bmo.ApiBaseBMO; |
| | | import com.java110.api.bmo.allocationUserStorehouse.IAllocationUserStorehouseBMO; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.resourceStore.ResourceStoreDto; |
| | | import com.java110.dto.userStorehouse.UserStorehouseDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.intf.store.IResourceStoreInnerServiceSMO; |
| | | import com.java110.intf.store.IUserStorehouseInnerServiceSMO; |
| | | import com.java110.po.allocationUserStorehouse.AllocationUserStorehousePo; |
| | | import com.java110.po.resourceStoreUseRecord.ResourceStoreUseRecordPo; |
| | | import com.java110.po.userStorehouse.UserStorehousePo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service("allocationUserStorehouseBMOImpl") |
| | | public class AllocationUserStorehouseBMOImpl extends ApiBaseBMO implements IAllocationUserStorehouseBMO { |
| | | public class AllocationUserStorehouseBMOImpl extends AbstractServiceApiPlusListener implements IAllocationUserStorehouseBMO { |
| | | |
| | | @Autowired |
| | | private IUserStorehouseInnerServiceSMO userStorehouseInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IResourceStoreInnerServiceSMO resourceStoreInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | |
| | | JSONArray json = JSONArray.parseArray(resourceStores); |
| | | if (json.size() > 0) { |
| | | Object[] objects = json.toArray(); |
| | | for (int i = 0; i < objects.length; i++) { |
| | | Object object = objects[i]; |
| | | JSONObject paramIn = JSONObject.parseObject(String.valueOf(object)); |
| | | String stock = paramIn.getString("stock"); |
| | | //获取最小计量总数 |
| | | String miniStock = paramIn.getString("miniStock"); |
| | | //获取最小计量单位数量 |
| | | String miniUnitStock = paramIn.getString("miniUnitStock"); |
| | | //获取转赠数量 |
| | | String giveQuantity = paramIn.getString("giveQuantity"); |
| | | //获取物品id |
| | | String resId = paramIn.getString("resId"); |
| | | //获取物品id |
| | | String resCode = paramIn.getString("resCode"); |
| | | //获取物品名称 |
| | | String resName = paramIn.getString("resName"); |
| | | //获取当前用户id |
| | | String userId = paramInJson.getString("userId"); |
| | | //获取接受转赠用户id |
| | | String acceptUserId = paramInJson.getString("acceptUserId"); |
| | | //获取接受转赠用户名称 |
| | | String acceptUserName = paramInJson.getString("acceptUserName"); |
| | | //获取商户id |
| | | String storeId = paramInJson.getString("storeId"); |
| | | JSONObject allocationUserStorehouseJson = new JSONObject(); |
| | | allocationUserStorehouseJson.put("ausId", "-1"); |
| | | allocationUserStorehouseJson.put("resId", resId); |
| | | allocationUserStorehouseJson.put("resCode", resCode); |
| | | allocationUserStorehouseJson.put("resName", resName); |
| | | allocationUserStorehouseJson.put("storeId", storeId); |
| | | allocationUserStorehouseJson.put("stock", stock); |
| | | allocationUserStorehouseJson.put("giveQuantity", giveQuantity); |
| | | allocationUserStorehouseJson.put("startUserId", userId); |
| | | allocationUserStorehouseJson.put("startUserName", paramInJson.getString("userName")); |
| | | allocationUserStorehouseJson.put("acceptUserId", acceptUserId); |
| | | allocationUserStorehouseJson.put("acceptUserName", acceptUserName); |
| | | allocationUserStorehouseJson.put("createTime", new Date()); |
| | | allocationUserStorehouseJson.put("remark", paramInJson.getString("description")); |
| | | AllocationUserStorehousePo allocationUserStorehousePo = BeanConvertUtil.covertBean(allocationUserStorehouseJson, AllocationUserStorehousePo.class); |
| | | super.insert(dataFlowContext, allocationUserStorehousePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ALLOCATION_USER_STOREHOUSE); |
| | | UserStorehouseDto userStorehouseDto = new UserStorehouseDto(); |
| | | userStorehouseDto.setUserId(userId); |
| | | userStorehouseDto.setResId(resId); |
| | | List<UserStorehouseDto> userStorehouseDtos = userStorehouseInnerServiceSMOImpl.queryUserStorehouses(userStorehouseDto); |
| | | Assert.listOnlyOne(userStorehouseDtos, "查询个人物品信息错误!"); |
| | | //获取个人物品信息id |
| | | String usId = userStorehouseDtos.get(0).getUsId(); |
| | | //获取物品单位 |
| | | if (StringUtil.isEmpty(userStorehouseDtos.get(0).getUnitCode())) { |
| | | throw new IllegalArgumentException("物品单位不能为空"); |
| | | } |
| | | String unitCode = userStorehouseDtos.get(0).getUnitCode(); |
| | | //获取物品最小计量单位 |
| | | if (StringUtil.isEmpty(userStorehouseDtos.get(0).getMiniUnitCode())) { |
| | | throw new IllegalArgumentException("物品最小计量单位不能为空"); |
| | | } |
| | | String miniUnitCode = userStorehouseDtos.get(0).getMiniUnitCode(); |
| | | UserStorehousePo userStorehousePo = new UserStorehousePo(); |
| | | userStorehousePo.setUsId(usId); |
| | | //转赠后个人物品最小计量总数 |
| | | BigDecimal num1 = new BigDecimal(miniStock); |
| | | BigDecimal num2 = new BigDecimal(giveQuantity); |
| | | BigDecimal quantity = num1.subtract(num2); |
| | | if (quantity.doubleValue() == 0.0) { |
| | | userStorehousePo.setMiniStock("0"); |
| | | userStorehousePo.setStock("0"); |
| | | } else { |
| | | userStorehousePo.setMiniStock(String.valueOf(quantity)); |
| | | BigDecimal reduceNum = num1.subtract(num2); |
| | | if (unitCode.equals(miniUnitCode)) { //如果物品单位与最小计量单位相同,就不向上取整 |
| | | userStorehousePo.setStock(String.valueOf(reduceNum)); |
| | | } else { //如果物品最小计量单位与物品单位不同,就向上取整 |
| | | //用转赠后最小计量总数除以最小计量单位数量,并向上取整,获取转赠后的库存数 |
| | | BigDecimal num3 = new BigDecimal(miniUnitStock); |
| | | BigDecimal unitStock = reduceNum.divide(num3, 2, BigDecimal.ROUND_HALF_UP); |
| | | Integer stockNumber = (int) Math.ceil(unitStock.doubleValue()); |
| | | userStorehousePo.setStock(String.valueOf(stockNumber)); |
| | | } |
| | | } |
| | | //更新当前用户库存数 |
| | | super.update(dataFlowContext, userStorehousePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_USER_STOREHOUSE); |
| | | UserStorehouseDto userStorehouse = new UserStorehouseDto(); |
| | | userStorehouse.setUserId(acceptUserId); |
| | | userStorehouse.setResCode(resCode); |
| | | //查询接受转赠人的个人物品信息 |
| | | List<UserStorehouseDto> userStorehouses = userStorehouseInnerServiceSMOImpl.queryUserStorehouses(userStorehouse); |
| | | if (userStorehouses != null && userStorehouses.size() == 1) { |
| | | UserStorehousePo userStorePo = new UserStorehousePo(); |
| | | //计算接受用户的最小计量总数 |
| | | BigDecimal num4 = new BigDecimal(userStorehouses.get(0).getMiniStock()); |
| | | BigDecimal num5 = new BigDecimal(giveQuantity); |
| | | BigDecimal addNum = num4.add(num5); |
| | | BigDecimal acceptMiniStock = num4.add(num5); |
| | | userStorePo.setMiniStock(String.valueOf(acceptMiniStock)); |
| | | String flag = paramInJson.getString("flag"); |
| | | if (!StringUtil.isEmpty(flag) && flag.equals("1")) { //损耗 |
| | | for (int i = 0; i < objects.length; i++) { |
| | | Object object = objects[i]; |
| | | JSONObject paramIn = JSONObject.parseObject(String.valueOf(object)); |
| | | ResourceStoreUseRecordPo resourceStoreUseRecordPo = new ResourceStoreUseRecordPo(); |
| | | resourceStoreUseRecordPo.setRsurId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_rsurId)); |
| | | resourceStoreUseRecordPo.setRepairId("-1"); //报修记录 |
| | | resourceStoreUseRecordPo.setResId(paramIn.getString("resId")); //物品资源id |
| | | resourceStoreUseRecordPo.setCommunityId(paramInJson.getString("communityId")); //小区id |
| | | resourceStoreUseRecordPo.setStoreId(paramInJson.getString("storeId")); //商户id |
| | | resourceStoreUseRecordPo.setQuantity(paramIn.getString("giveQuantity")); //损耗数量 |
| | | //根据物品资源id查询物品资源信息 |
| | | ResourceStoreDto resourceStoreDto = new ResourceStoreDto(); |
| | | resourceStoreDto.setResId(paramIn.getString("resId")); |
| | | List<ResourceStoreDto> resourceStoreDtos = resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto); |
| | | Assert.listOnlyOne(resourceStoreDtos, "查询房屋信息错误!"); |
| | | resourceStoreUseRecordPo.setUnitPrice(resourceStoreDtos.get(0).getPrice()); //物品资源单价 |
| | | resourceStoreUseRecordPo.setCreateUserId(paramInJson.getString("userId")); //创建人id |
| | | resourceStoreUseRecordPo.setCreateUserName(paramInJson.getString("userName")); //创建人名称 |
| | | resourceStoreUseRecordPo.setRemark(paramIn.getString("purchaseRemark")); //备注 |
| | | resourceStoreUseRecordPo.setResourceStoreName(paramIn.getString("resName")); //物品名称 |
| | | resourceStoreUseRecordPo.setState(paramIn.getString("state")); //1001 报废回收 2002 工单损耗 3003 公用损耗 |
| | | super.insert(dataFlowContext, resourceStoreUseRecordPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_RESOURCE_STORE_USE_RECORD); |
| | | //个人物品处理 |
| | | UserStorehouseDto userStorehouseDto = new UserStorehouseDto(); |
| | | userStorehouseDto.setUserId(paramInJson.getString("userId")); |
| | | userStorehouseDto.setResId(paramIn.getString("resId")); |
| | | //查询个人物品信息 |
| | | List<UserStorehouseDto> userStorehouseDtos = userStorehouseInnerServiceSMOImpl.queryUserStorehouses(userStorehouseDto); |
| | | Assert.listOnlyOne(userStorehouseDtos, "查询个人物品信息错误!"); |
| | | //获取个人物品信息id |
| | | String usId = userStorehouseDtos.get(0).getUsId(); |
| | | //获取物品单位 |
| | | if (StringUtil.isEmpty(userStorehouses.get(0).getUnitCode())) { |
| | | if (StringUtil.isEmpty(userStorehouseDtos.get(0).getUnitCode())) { |
| | | throw new IllegalArgumentException("物品单位不能为空"); |
| | | } |
| | | String unitCode1 = userStorehouses.get(0).getUnitCode(); |
| | | String unitCode = userStorehouseDtos.get(0).getUnitCode(); //物品单位 |
| | | //获取物品最小计量单位 |
| | | if (StringUtil.isEmpty(userStorehouses.get(0).getMiniUnitCode())) { |
| | | if (StringUtil.isEmpty(userStorehouseDtos.get(0).getMiniUnitCode())) { |
| | | throw new IllegalArgumentException("物品最小计量单位不能为空"); |
| | | } |
| | | String miniUnitCode1 = userStorehouses.get(0).getMiniUnitCode(); |
| | | //计算接受用户的库存数量 |
| | | BigDecimal num6 = new BigDecimal(miniUnitStock); |
| | | BigDecimal unitStock = addNum.divide(num6, 2, BigDecimal.ROUND_HALF_UP); |
| | | if (unitCode1.equals(miniUnitCode1)) { //如果物品单位与物品最小计量单位相同,就不向上取整 |
| | | //如果物品单位与最小计量单位相同,物品库存就等于最小计量总数 |
| | | userStorePo.setStock(String.valueOf(acceptMiniStock)); |
| | | } else { //如果物品单位与物品最小计量单位不同,就向上取整 |
| | | Integer stockNumber = (int) Math.ceil(unitStock.doubleValue()); |
| | | userStorePo.setStock(String.valueOf(stockNumber)); |
| | | String miniUnitCode = userStorehouseDtos.get(0).getMiniUnitCode(); //物品最小计量单位 |
| | | UserStorehousePo userStorehousePo = new UserStorehousePo(); |
| | | userStorehousePo.setUsId(usId); //个人物品id |
| | | //获取最小单位计量总数 |
| | | String miniStock = userStorehouseDtos.get(0).getMiniStock(); |
| | | //获取最小计量单位数量 |
| | | String miniUnitStock = paramIn.getString("miniUnitStock"); |
| | | //获取报废数量 |
| | | String giveQuantity = paramIn.getString("giveQuantity"); |
| | | //除去报废个人物品剩余的最小单位计量总数 |
| | | BigDecimal num1 = new BigDecimal(miniStock); |
| | | BigDecimal num2 = new BigDecimal(giveQuantity); |
| | | BigDecimal quantity = num1.subtract(num2); |
| | | if (quantity.doubleValue() == 0.0) { //如果减去报废后剩余0个,那么最小计量单位总数和物品数量都变为0 |
| | | userStorehousePo.setMiniStock("0"); |
| | | userStorehousePo.setStock("0"); |
| | | } else { |
| | | userStorehousePo.setMiniStock(String.valueOf(quantity)); //减去报废后剩余的最小计量单位总数 |
| | | BigDecimal reduceNum = num1.subtract(num2); |
| | | if (unitCode.equals(miniUnitCode)) { //如果物品单位与最小计量单位相同,就不向上取整 |
| | | userStorehousePo.setStock(String.valueOf(reduceNum)); |
| | | } else { //如果物品最小计量单位与物品单位不同,就向上取整 |
| | | //用转赠后最小计量总数除以最小计量单位数量,并向上取整,获取转赠后的库存数 |
| | | BigDecimal num3 = new BigDecimal(miniUnitStock); |
| | | BigDecimal unitStock = reduceNum.divide(num3, 2, BigDecimal.ROUND_HALF_UP); |
| | | Integer stockNumber = (int) Math.ceil(unitStock.doubleValue()); |
| | | userStorehousePo.setStock(String.valueOf(stockNumber)); //减去报废后剩余的个人物品数量 |
| | | } |
| | | } |
| | | userStorePo.setUsId(userStorehouses.get(0).getUsId()); |
| | | //更新当前用户的库存数量 |
| | | super.update(dataFlowContext, userStorePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_USER_STOREHOUSE); |
| | | } else if (userStorehouses != null && userStorehouses.size() > 1) { |
| | | throw new IllegalArgumentException("查询个人物品信息错误!"); |
| | | } else { |
| | | //计算转赠后库存数量 |
| | | BigDecimal num7 = new BigDecimal(giveQuantity); |
| | | BigDecimal num8 = new BigDecimal(miniUnitStock); |
| | | BigDecimal unitStock = num7.divide(num8, 2, BigDecimal.ROUND_HALF_UP); |
| | | UserStorehousePo userStorePo = new UserStorehousePo(); |
| | | userStorePo.setUsId("-1"); |
| | | userStorePo.setResId(resId); |
| | | userStorePo.setResName(resName); |
| | | userStorePo.setStoreId(storeId); |
| | | userStorePo.setResCode(resCode); |
| | | if (unitCode.equals(miniUnitCode)) { //如果物品单位与物品最小计量单位相同,就不向上取整 |
| | | userStorePo.setStock(String.valueOf(num7)); |
| | | } else { //如果物品单位与物品最小计量单位不同,就向上取整 |
| | | Integer stockNumber = (int) Math.ceil(unitStock.doubleValue()); |
| | | userStorePo.setStock(String.valueOf(stockNumber)); |
| | | //更新当前用户个人物品库存数 |
| | | super.update(dataFlowContext, userStorehousePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_USER_STOREHOUSE); |
| | | commit(dataFlowContext); |
| | | } |
| | | } else { //退还 |
| | | for (int i = 0; i < objects.length; i++) { |
| | | Object object = objects[i]; |
| | | JSONObject paramIn = JSONObject.parseObject(String.valueOf(object)); |
| | | String stock = paramIn.getString("stock"); |
| | | //获取最小计量总数 |
| | | String miniStock = paramIn.getString("miniStock"); |
| | | //获取最小计量单位数量 |
| | | String miniUnitStock = paramIn.getString("miniUnitStock"); |
| | | //获取转赠数量 |
| | | String giveQuantity = paramIn.getString("giveQuantity"); |
| | | //获取物品id |
| | | String resId = paramIn.getString("resId"); |
| | | //获取物品id |
| | | String resCode = paramIn.getString("resCode"); |
| | | //获取物品名称 |
| | | String resName = paramIn.getString("resName"); |
| | | //获取当前用户id |
| | | String userId = paramInJson.getString("userId"); |
| | | //获取接受转赠用户id |
| | | String acceptUserId = paramInJson.getString("acceptUserId"); |
| | | //获取接受转赠用户名称 |
| | | String acceptUserName = paramInJson.getString("acceptUserName"); |
| | | //获取商户id |
| | | String storeId = paramInJson.getString("storeId"); |
| | | JSONObject allocationUserStorehouseJson = new JSONObject(); |
| | | allocationUserStorehouseJson.put("ausId", "-1"); |
| | | allocationUserStorehouseJson.put("resId", resId); |
| | | allocationUserStorehouseJson.put("resCode", resCode); |
| | | allocationUserStorehouseJson.put("resName", resName); |
| | | allocationUserStorehouseJson.put("storeId", storeId); |
| | | allocationUserStorehouseJson.put("stock", stock); |
| | | allocationUserStorehouseJson.put("giveQuantity", giveQuantity); |
| | | allocationUserStorehouseJson.put("startUserId", userId); |
| | | allocationUserStorehouseJson.put("startUserName", paramInJson.getString("userName")); |
| | | allocationUserStorehouseJson.put("acceptUserId", acceptUserId); |
| | | allocationUserStorehouseJson.put("acceptUserName", acceptUserName); |
| | | allocationUserStorehouseJson.put("createTime", new Date()); |
| | | allocationUserStorehouseJson.put("remark", paramInJson.getString("description")); |
| | | AllocationUserStorehousePo allocationUserStorehousePo = BeanConvertUtil.covertBean(allocationUserStorehouseJson, AllocationUserStorehousePo.class); |
| | | super.insert(dataFlowContext, allocationUserStorehousePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ALLOCATION_USER_STOREHOUSE); |
| | | UserStorehouseDto userStorehouseDto = new UserStorehouseDto(); |
| | | userStorehouseDto.setUserId(userId); |
| | | userStorehouseDto.setResId(resId); |
| | | List<UserStorehouseDto> userStorehouseDtos = userStorehouseInnerServiceSMOImpl.queryUserStorehouses(userStorehouseDto); |
| | | Assert.listOnlyOne(userStorehouseDtos, "查询个人物品信息错误!"); |
| | | //获取个人物品信息id |
| | | String usId = userStorehouseDtos.get(0).getUsId(); |
| | | //获取物品单位 |
| | | if (StringUtil.isEmpty(userStorehouseDtos.get(0).getUnitCode())) { |
| | | throw new IllegalArgumentException("物品单位不能为空"); |
| | | } |
| | | userStorePo.setMiniStock(giveQuantity); |
| | | userStorePo.setUserId(acceptUserId); |
| | | //保存接受转赠用户个人物品信息 |
| | | super.insert(dataFlowContext, userStorePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_USER_STOREHOUSE); |
| | | String unitCode = userStorehouseDtos.get(0).getUnitCode(); |
| | | //获取物品最小计量单位 |
| | | if (StringUtil.isEmpty(userStorehouseDtos.get(0).getMiniUnitCode())) { |
| | | throw new IllegalArgumentException("物品最小计量单位不能为空"); |
| | | } |
| | | String miniUnitCode = userStorehouseDtos.get(0).getMiniUnitCode(); |
| | | UserStorehousePo userStorehousePo = new UserStorehousePo(); |
| | | userStorehousePo.setUsId(usId); |
| | | //转赠后个人物品最小计量总数 |
| | | BigDecimal num1 = new BigDecimal(miniStock); |
| | | BigDecimal num2 = new BigDecimal(giveQuantity); |
| | | BigDecimal quantity = num1.subtract(num2); |
| | | if (quantity.doubleValue() == 0.0) { |
| | | userStorehousePo.setMiniStock("0"); |
| | | userStorehousePo.setStock("0"); |
| | | } else { |
| | | userStorehousePo.setMiniStock(String.valueOf(quantity)); |
| | | BigDecimal reduceNum = num1.subtract(num2); |
| | | if (unitCode.equals(miniUnitCode)) { //如果物品单位与最小计量单位相同,就不向上取整 |
| | | userStorehousePo.setStock(String.valueOf(reduceNum)); |
| | | } else { //如果物品最小计量单位与物品单位不同,就向上取整 |
| | | //用转赠后最小计量总数除以最小计量单位数量,并向上取整,获取转赠后的库存数 |
| | | BigDecimal num3 = new BigDecimal(miniUnitStock); |
| | | BigDecimal unitStock = reduceNum.divide(num3, 2, BigDecimal.ROUND_HALF_UP); |
| | | Integer stockNumber = (int) Math.ceil(unitStock.doubleValue()); |
| | | userStorehousePo.setStock(String.valueOf(stockNumber)); |
| | | } |
| | | } |
| | | //更新当前用户库存数 |
| | | super.update(dataFlowContext, userStorehousePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_USER_STOREHOUSE); |
| | | UserStorehouseDto userStorehouse = new UserStorehouseDto(); |
| | | userStorehouse.setUserId(acceptUserId); |
| | | userStorehouse.setResCode(resCode); |
| | | //查询接受转赠人的个人物品信息 |
| | | List<UserStorehouseDto> userStorehouses = userStorehouseInnerServiceSMOImpl.queryUserStorehouses(userStorehouse); |
| | | if (userStorehouses != null && userStorehouses.size() == 1) { |
| | | UserStorehousePo userStorePo = new UserStorehousePo(); |
| | | //计算接受用户的最小计量总数 |
| | | BigDecimal num4 = new BigDecimal(userStorehouses.get(0).getMiniStock()); |
| | | BigDecimal num5 = new BigDecimal(giveQuantity); |
| | | BigDecimal addNum = num4.add(num5); |
| | | BigDecimal acceptMiniStock = num4.add(num5); |
| | | userStorePo.setMiniStock(String.valueOf(acceptMiniStock)); |
| | | //获取物品单位 |
| | | if (StringUtil.isEmpty(userStorehouses.get(0).getUnitCode())) { |
| | | throw new IllegalArgumentException("物品单位不能为空"); |
| | | } |
| | | String unitCode1 = userStorehouses.get(0).getUnitCode(); |
| | | //获取物品最小计量单位 |
| | | if (StringUtil.isEmpty(userStorehouses.get(0).getMiniUnitCode())) { |
| | | throw new IllegalArgumentException("物品最小计量单位不能为空"); |
| | | } |
| | | String miniUnitCode1 = userStorehouses.get(0).getMiniUnitCode(); |
| | | //计算接受用户的库存数量 |
| | | BigDecimal num6 = new BigDecimal(miniUnitStock); |
| | | BigDecimal unitStock = addNum.divide(num6, 2, BigDecimal.ROUND_HALF_UP); |
| | | if (unitCode1.equals(miniUnitCode1)) { //如果物品单位与物品最小计量单位相同,就不向上取整 |
| | | //如果物品单位与最小计量单位相同,物品库存就等于最小计量总数 |
| | | userStorePo.setStock(String.valueOf(acceptMiniStock)); |
| | | } else { //如果物品单位与物品最小计量单位不同,就向上取整 |
| | | Integer stockNumber = (int) Math.ceil(unitStock.doubleValue()); |
| | | userStorePo.setStock(String.valueOf(stockNumber)); |
| | | } |
| | | userStorePo.setUsId(userStorehouses.get(0).getUsId()); |
| | | //更新当前用户的库存数量 |
| | | super.update(dataFlowContext, userStorePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_USER_STOREHOUSE); |
| | | } else if (userStorehouses != null && userStorehouses.size() > 1) { |
| | | throw new IllegalArgumentException("查询个人物品信息错误!"); |
| | | } else { |
| | | //计算转赠后库存数量 |
| | | BigDecimal num7 = new BigDecimal(giveQuantity); |
| | | BigDecimal num8 = new BigDecimal(miniUnitStock); |
| | | BigDecimal unitStock = num7.divide(num8, 2, BigDecimal.ROUND_HALF_UP); |
| | | UserStorehousePo userStorePo = new UserStorehousePo(); |
| | | userStorePo.setUsId("-1"); |
| | | userStorePo.setResId(resId); |
| | | userStorePo.setResName(resName); |
| | | userStorePo.setStoreId(storeId); |
| | | userStorePo.setResCode(resCode); |
| | | if (unitCode.equals(miniUnitCode)) { //如果物品单位与物品最小计量单位相同,就不向上取整 |
| | | userStorePo.setStock(String.valueOf(num7)); |
| | | } else { //如果物品单位与物品最小计量单位不同,就向上取整 |
| | | Integer stockNumber = (int) Math.ceil(unitStock.doubleValue()); |
| | | userStorePo.setStock(String.valueOf(stockNumber)); |
| | | } |
| | | userStorePo.setMiniStock(giveQuantity); |
| | | userStorePo.setUserId(acceptUserId); |
| | | //保存接受转赠用户个人物品信息 |
| | | super.insert(dataFlowContext, userStorePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_USER_STOREHOUSE); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | super.update(dataFlowContext, allocationUserStorehousePo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_ALLOCATION_USER_STOREHOUSE); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> callService(ServiceDataFlowEvent event) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> callService(DataFlowContext context, String serviceCode, JSONArray businesses) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> callService(DataFlowContext context, String serviceCode, JSONObject businesses) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> callService(DataFlowContext context, AppService appService, Map paramIn) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public JSONObject restToCenterProtocol(JSONObject businesses, Map<String, String> headers) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void freshHttpHeader(HttpHeaders httpHeaders, Map<String, String> headers) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) throws ParseException { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) throws ParseException { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.components.assetImport; |
| | | |
| | | import com.java110.api.smo.assetExport.IExportOwnerCarSMO; |
| | | import com.java110.api.smo.assetImport.impl.ImportOwnerCarSMOImpl; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.context.PageData; |
| | | import com.java110.dto.app.AppDto; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 添加应用组件 |
| | | * |
| | | * @author fqz |
| | | * @date 2021-12-21 |
| | | */ |
| | | @Component("importOwnerCar") |
| | | public class ImportOwnerCarComponent { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ImportOwnerCarComponent.class); |
| | | |
| | | @Autowired |
| | | private ImportOwnerCarSMOImpl importOwnerCarSMOImpl; |
| | | |
| | | @Autowired |
| | | private IExportOwnerCarSMO exportOwnerCarSMOImpl; |
| | | |
| | | /** |
| | | * 添加应用数据 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> importData(IPageData pd, MultipartFile uploadFile) throws Exception { |
| | | return importOwnerCarSMOImpl.importExcelData(pd, uploadFile); |
| | | } |
| | | |
| | | /** |
| | | * 添加应用数据 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<Object> exportData(IPageData pd) throws Exception { |
| | | IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(), pd.getReqData(), pd.getComponentCode(), pd.getComponentMethod(), "", |
| | | pd.getSessionId(), AppDto.WEB_APP_ID, pd.getHeaders()); |
| | | return exportOwnerCarSMOImpl.exportExcelData(newPd); |
| | | } |
| | | |
| | | } |
| | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | |
| | | ComplaintDto complaintDto = BeanConvertUtil.covertBean(reqJson, ComplaintDto.class); |
| | | |
| | | String roomId=reqJson.getString("roomId"); |
| | | String roomId = reqJson.getString("roomId"); |
| | | if (!StringUtil.isEmpty(roomId) && roomId.contains("-")) { |
| | | String[] values = roomId.split("-"); |
| | | if (values.length == 3) { |
| | |
| | | DistributedLock.waitGetDistributedLock(key, requestId); |
| | | //获取当前处理员工id |
| | | String staffId = reqJson.getString("userId"); |
| | | RepairUserDto repairUser = new RepairUserDto(); |
| | | /*RepairUserDto repairUser = new RepairUserDto(); |
| | | repairUser.setStaffId(staffId); |
| | | repairUser.setState("10001"); //处理中 |
| | | int i = repairUserInnerServiceSMOImpl.queryRepairUsersCount(repairUser); |
| | | int i = repairUserInnerServiceSMOImpl.queryRepairUsersCount(repairUser);*/ |
| | | RepairDto repair = new RepairDto(); |
| | | repair.setStaffId(staffId); |
| | | repair.setCommunityId(reqJson.getString("communityId")); |
| | | int i = repairInnerServiceSMOImpl.queryStaffRepairsCount(repair); |
| | | //取出开关映射的值(维修师傅未处理最大单数) |
| | | String repairNumber = MappingCache.getValue(DOMAIN_COMMON, REPAIR_NUMBER); |
| | | if (i >= Integer.parseInt(repairNumber)) { |
| | |
| | | private void transferRepair(DataFlowContext context, JSONObject reqJson) { |
| | | //获取接受转单的员工 |
| | | String staffId = reqJson.getString("staffId"); |
| | | RepairUserDto repairUser = new RepairUserDto(); |
| | | repairUser.setStaffId(staffId); |
| | | repairUser.setState("10001"); //处理中 |
| | | int i = repairUserInnerServiceSMOImpl.queryRepairUsersCount(repairUser); |
| | | RepairDto repair = new RepairDto(); |
| | | repair.setStaffId(staffId); |
| | | repair.setState("10001"); //处理中 |
| | | int i = repairInnerServiceSMOImpl.queryStaffRepairsCount(repair); |
| | | //取出开关映射的值(维修师傅未处理最大单数) |
| | | String repairNumber = MappingCache.getValue(DOMAIN_COMMON, REPAIR_NUMBER); |
| | | if (i >= Integer.parseInt(repairNumber)) { |
| | |
| | | private void dispacthRepair(DataFlowContext context, JSONObject reqJson) { |
| | | //获取接受派单的员工 |
| | | String staffId = reqJson.getString("staffId"); |
| | | RepairUserDto repairUser = new RepairUserDto(); |
| | | repairUser.setStaffId(staffId); |
| | | repairUser.setState("10001"); //处理中 |
| | | int i = repairUserInnerServiceSMOImpl.queryRepairUsersCount(repairUser); |
| | | RepairDto repair = new RepairDto(); |
| | | repair.setStaffId(staffId); |
| | | repair.setState("10001"); //处理中 |
| | | int i = repairInnerServiceSMOImpl.queryStaffRepairsCount(repair); |
| | | //取出开关映射的值(维修师傅未处理最大单数) |
| | | String repairNumber = MappingCache.getValue(DOMAIN_COMMON, REPAIR_NUMBER); |
| | | if (i >= Integer.parseInt(repairNumber)) { |
| | |
| | | resourceStoreUseRecordPo.setCreateUserName(reqJson.getString("userName")); |
| | | resourceStoreUseRecordPo.setRemark(reqJson.getString("context")); |
| | | resourceStoreUseRecordPo.setQuantity(useNumber); |
| | | resourceStoreUseRecordPo.setState("2002"); //1001 报废回收 2002 工单损耗 3003 公用损耗 |
| | | //有偿服务 |
| | | if (maintenanceType.equals("1001")) { |
| | | resourceStoreUseRecordPo.setUnitPrice(paramIn.getString("price")); |
| New file |
| | |
| | | package com.java110.api.listener.ownerRepair; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.po.owner.RepairPoolPo; |
| | | import com.java110.po.owner.RepairUserPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ServiceCodeRepairDispatchStepConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 启动报修单 |
| | | * |
| | | * @author fqz |
| | | * @date 2021-12-24 |
| | | */ |
| | | @Java110Listener("repairStartListener") |
| | | public class RepairStartListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeRepairDispatchStepConstant.BINDING_REPAIR_START; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息"); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | RepairDto repairDto = new RepairDto(); |
| | | repairDto.setRepairId(reqJson.getString("repairId")); |
| | | //查询报修信息 |
| | | List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto); |
| | | Assert.listOnlyOne(repairDtos, "查询报修信息错误!"); |
| | | String state = repairDtos.get(0).getState(); |
| | | if (!StringUtil.isEmpty(state) && state.equals(RepairDto.STATE_STOP)) { //状态是暂停状态 |
| | | RepairPoolPo repairPoolPo = new RepairPoolPo(); |
| | | repairPoolPo.setRepairId(reqJson.getString("repairId")); |
| | | repairPoolPo.setState(RepairDto.STATE_TAKING); //状态变为接单状态 |
| | | super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR); |
| | | RepairUserDto repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairId(reqJson.getString("repairId")); |
| | | repairUserDto.setState(RepairUserDto.STATE_STOP); //暂停状态 |
| | | //查询报修派单 |
| | | List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | if (repairUserDtos != null && repairUserDtos.size() > 0) { |
| | | for (RepairUserDto repairUser : repairUserDtos) { |
| | | if (repairUser.getEndTime() == null) { |
| | | RepairUserPo repairUserPo = new RepairUserPo(); |
| | | repairUserPo.setRuId(repairUser.getRuId()); |
| | | repairUserPo.setEndTime(simpleDateFormat.format(new Date())); |
| | | //修改暂停报修状态 |
| | | super.update(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_USER); |
| | | } |
| | | } |
| | | } else { |
| | | throw new IllegalArgumentException("启动报修单错误!"); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.ownerRepair; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | 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.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.po.owner.RepairPoolPo; |
| | | import com.java110.po.owner.RepairUserPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ServiceCodeRepairDispatchStepConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 暂停报修单 |
| | | * |
| | | * @author fqz |
| | | * @date 2021-12-24 |
| | | */ |
| | | @Java110Listener("repairStopListener") |
| | | public class RepairStopListener extends AbstractServiceApiPlusListener { |
| | | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeRepairDispatchStepConstant.BINDING_REPAIR_STOP; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) throws ParseException { |
| | | Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息"); |
| | | Assert.hasKeyAndValue(reqJson, "remark", "未包含派单内容"); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息"); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) throws ParseException { |
| | | RepairDto repairDto = new RepairDto(); |
| | | repairDto.setRepairId(reqJson.getString("repairId")); |
| | | //查询报修信息 |
| | | List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto); |
| | | Assert.listOnlyOne(repairDtos, "查询报修单错误!"); |
| | | String state = repairDtos.get(0).getState(); |
| | | if (!StringUtil.isEmpty(state) && !state.equals(RepairDto.STATE_STOP)) { //报修单不是暂停状态 |
| | | RepairPoolPo repairPoolPo = BeanConvertUtil.covertBean(reqJson, RepairPoolPo.class); |
| | | repairPoolPo.setState(RepairDto.STATE_STOP); //将报修状态变为暂停状态 |
| | | //更新报修状态 |
| | | super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR); |
| | | RepairUserPo repairUserPo = new RepairUserPo(); |
| | | repairUserPo.setRuId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ruId)); //报修派单id |
| | | repairUserPo.setRepairId(reqJson.getString("repairId")); //报修派单 |
| | | repairUserPo.setCommunityId(reqJson.getString("communityId")); //小区id |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | repairUserPo.setCreateTime(simpleDateFormat.format(new Date())); //创建时间 |
| | | repairUserPo.setState(RepairUserDto.STATE_STOP); //状态(暂停状态) |
| | | repairUserPo.setContext(reqJson.getString("remark")); //报修内容 |
| | | repairUserPo.setStaffId(reqJson.getString("userId")); //当前处理员工id |
| | | repairUserPo.setStaffName(reqJson.getString("userName")); //当前处理员工名称 |
| | | RepairUserDto repairUserDto = new RepairUserDto(); |
| | | repairUserDto.setRepairId(reqJson.getString("repairId")); |
| | | repairUserDto.setState(RepairUserDto.STATE_DOING); //处理中状态 |
| | | //查询报修派单 |
| | | List<RepairUserDto> repairUserDtos = repairUserInnerServiceSMOImpl.queryRepairUsers(repairUserDto); |
| | | Assert.listOnlyOne(repairUserDtos, "查询报修派单错误!"); |
| | | repairUserPo.setPreStaffId(repairUserDtos.get(0).getStaffId()); //上一节点处理员工id |
| | | repairUserPo.setPreStaffName(repairUserDtos.get(0).getStaffName()); //上一节点处理员工名称 |
| | | repairUserPo.setStartTime(simpleDateFormat.format(new Date())); //开始时间 |
| | | repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_AUDIT_USER); //审核用户 |
| | | repairUserPo.setPreRuId(repairUserDtos.get(0).getRuId()); //上一节点处理id |
| | | super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(reqJson, "acceptUserId", "请求报文中未包含acceptUserId"); |
| | | //Assert.hasKeyAndValue(reqJson, "acceptUserId", "请求报文中未包含acceptUserId"); |
| | | Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId"); |
| | | } |
| | | |
| New file |
| | |
| | | package com.java110.api.smo.assetExport; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * @author fqz |
| | | * @date 2021-12-21 |
| | | */ |
| | | public interface IExportOwnerCarSMO { |
| | | |
| | | /** |
| | | * 导入excel数据 |
| | | * |
| | | * @param pd 前台数据封装 |
| | | * @return ResponseEntity |
| | | */ |
| | | public ResponseEntity<Object> exportExcelData(IPageData pd) throws Exception; |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.smo.assetExport.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.smo.DefaultAbstractComponentSMO; |
| | | import com.java110.api.smo.assetExport.IExportOwnerCarSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.DateUtil; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | |
| | | @Service("exportOwnerCarSMOImpl") |
| | | public class ExportOwnerCarSMOImpl extends DefaultAbstractComponentSMO implements IExportOwnerCarSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | public ResponseEntity<Object> exportExcelData(IPageData pd) throws Exception { |
| | | ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | Assert.hasKeyAndValue(JSONObject.parseObject(pd.getReqData()), "communityId", "请求中未包含小区"); |
| | | Workbook workbook = null; //工作簿 |
| | | //工作表 |
| | | workbook = new XSSFWorkbook(); |
| | | //获取楼信息 |
| | | getOwnerCar(pd, result, workbook); |
| | | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| | | MultiValueMap headers = new HttpHeaders(); |
| | | headers.add("content-type", "application/octet-stream;charset=UTF-8"); |
| | | headers.add("Content-Disposition", "attachment;filename=ownerCarImport_" + DateUtil.getyyyyMMddhhmmssDateString() + ".xlsx"); |
| | | headers.add("Pargam", "no-cache"); |
| | | headers.add("Cache-Control", "no-cache"); |
| | | //headers.add("Content-Disposition", "attachment; filename=" + outParam.getString("fileName")); |
| | | headers.add("Accept-Ranges", "bytes"); |
| | | byte[] context = null; |
| | | try { |
| | | workbook.write(os); |
| | | context = os.toByteArray(); |
| | | os.close(); |
| | | workbook.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | // 保存数据 |
| | | return new ResponseEntity<Object>("导出失败", HttpStatus.INTERNAL_SERVER_ERROR); |
| | | } |
| | | // 保存数据 |
| | | return new ResponseEntity<Object>(context, headers, HttpStatus.OK); |
| | | } |
| | | |
| | | /** |
| | | * 获取 房屋信息 |
| | | * |
| | | * @param componentValidateResult |
| | | * @param workbook |
| | | */ |
| | | private void getOwnerCar(IPageData pd, ComponentValidateResult componentValidateResult, Workbook workbook) { |
| | | Sheet sheet = workbook.createSheet("业主车辆信息"); |
| | | Row row = sheet.createRow(0); |
| | | Cell cell0 = row.createCell(0); |
| | | cell0.setCellValue("房屋号: 格式为xx-xx-xx(楼栋-单元-房屋);\n车辆类型:9901表示家用小汽车,9902表示客车,9903表示货车;" + |
| | | "\n车位:xx-xx(停车场-车位)" + "\n起租时间: 格式为YYYY-MM-DD HH:mm:ss;\n截止时间: 格式为YYYY-MM-DD HH:mm:ss;" + |
| | | "\n停车场类型:1001表示地上停车场,2001表示地下停车场;\n车位状态:S表示出售,H表示出租;" + |
| | | "\n注意:所有单元格式为文本"); |
| | | CellStyle cs = workbook.createCellStyle(); |
| | | cs.setWrapText(true); //关键 |
| | | cell0.setCellStyle(cs); |
| | | row.setHeight((short) (200 * 10)); |
| | | row = sheet.createRow(1); |
| | | row.createCell(0).setCellValue("车牌号"); |
| | | row.createCell(1).setCellValue("房屋号"); |
| | | row.createCell(2).setCellValue("车辆品牌"); |
| | | row.createCell(3).setCellValue("车辆类型"); |
| | | row.createCell(4).setCellValue("颜色"); |
| | | row.createCell(5).setCellValue("业主"); |
| | | row.createCell(6).setCellValue("车位"); |
| | | row.createCell(7).setCellValue("起租时间"); |
| | | row.createCell(8).setCellValue("截止时间"); |
| | | row.createCell(9).setCellValue("停车场类型"); |
| | | row.createCell(10).setCellValue("车位类型"); |
| | | CellRangeAddress region = new CellRangeAddress(0, 0, 0, 8); |
| | | sheet.addMergedRegion(region); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| | |
| | | row.createCell(4).setCellValue("物品名称"); |
| | | row.createCell(5).setCellValue("物品规格"); |
| | | row.createCell(6).setCellValue("是否是固定物品"); |
| | | row.createCell(7).setCellValue("物品使用数量"); |
| | | row.createCell(8).setCellValue("物品价格"); |
| | | row.createCell(9).setCellValue("使用人ID"); |
| | | row.createCell(10).setCellValue("使用人"); |
| | | row.createCell(11).setCellValue("创建时间"); |
| | | row.createCell(12).setCellValue("备注"); |
| | | row.createCell(7).setCellValue("物品使用类型"); |
| | | row.createCell(8).setCellValue("物品使用数量"); |
| | | row.createCell(9).setCellValue("物品价格"); |
| | | row.createCell(10).setCellValue("使用人ID"); |
| | | row.createCell(11).setCellValue("使用人"); |
| | | row.createCell(12).setCellValue("创建时间"); |
| | | row.createCell(13).setCellValue("备注"); |
| | | JSONArray resourceStoreUseRecords = this.getResourceStoreUseRecordManage(pd, result); |
| | | if (resourceStoreUseRecords == null || resourceStoreUseRecords.size() == 0) { |
| | | return; |
| | |
| | | row.createCell(4).setCellValue(dataObj.getString("resourceStoreName")); |
| | | row.createCell(5).setCellValue(dataObj.getString("specName")); |
| | | row.createCell(6).setCellValue(dataObj.getString("isFixedName")); |
| | | row.createCell(7).setCellValue(dataObj.getString("quantity") + dataObj.getString("miniUnitCodeName")); |
| | | row.createCell(8).setCellValue(dataObj.getString("unitPrice")); |
| | | row.createCell(9).setCellValue(dataObj.getString("createUserId")); |
| | | row.createCell(10).setCellValue(dataObj.getString("createUserName")); |
| | | row.createCell(11).setCellValue(dataObj.getString("createTime")); |
| | | row.createCell(12).setCellValue(dataObj.getString("remark")); |
| | | row.createCell(7).setCellValue(dataObj.getString("stateName")); |
| | | row.createCell(8).setCellValue(dataObj.getString("quantity") + dataObj.getString("miniUnitCodeName")); |
| | | row.createCell(9).setCellValue(dataObj.getString("unitPrice")); |
| | | row.createCell(10).setCellValue(dataObj.getString("createUserId")); |
| | | row.createCell(11).setCellValue(dataObj.getString("createUserName")); |
| | | row.createCell(12).setCellValue(dataObj.getString("createTime")); |
| | | row.createCell(13).setCellValue(dataObj.getString("remark")); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | package com.java110.api.smo.assetImport; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * @author fqz |
| | | * @date 2021-12-21 |
| | | */ |
| | | public interface IImportOwnerCarSMO { |
| | | |
| | | /** |
| | | * 导入excel数据 |
| | | * |
| | | * @param pd 前台数据封装 |
| | | * @param uploadFile excel 文件 |
| | | * @return ResponseEntity |
| | | */ |
| | | public ResponseEntity<String> importExcelData(IPageData pd, MultipartFile uploadFile) throws Exception; |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.smo.assetImport.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.smo.DefaultAbstractComponentSMO; |
| | | import com.java110.api.smo.assetImport.IImportOwnerCarSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.FloorDto; |
| | | import com.java110.dto.RoomDto; |
| | | import com.java110.dto.UnitDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.dto.parking.ParkingAreaDto; |
| | | import com.java110.dto.parking.ParkingSpaceDto; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.intf.community.*; |
| | | import com.java110.intf.user.*; |
| | | import com.java110.po.car.OwnerCarPo; |
| | | import com.java110.po.parking.ParkingSpacePo; |
| | | import com.java110.utils.util.*; |
| | | import com.java110.vo.ResultVo; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service("importOwnerCarSMOImpl") |
| | | public class ImportOwnerCarSMOImpl extends DefaultAbstractComponentSMO implements IImportOwnerCarSMO { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ImportOwnerCarSMOImpl.class); |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private IOwnerCarV1InnerServiceSMO ownerCarV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IFloorInnerServiceSMO floorInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUnitInnerServiceSMO unitInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRoomInnerServiceSMO roomInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IParkingAreaInnerServiceSMO parkingAreaInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> importExcelData(IPageData pd, MultipartFile uploadFile) throws Exception { |
| | | try { |
| | | ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | //InputStream is = uploadFile.getInputStream(); |
| | | Workbook workbook = ImportExcelUtils.createWorkbook(uploadFile); //工作簿 |
| | | List<OwnerCarDto> ownerCars = new ArrayList<OwnerCarDto>(); |
| | | //获取楼信息 |
| | | getOwnerCars(workbook, ownerCars); |
| | | // 保存数据 |
| | | return dealExcelData(pd, ownerCars, result); |
| | | } catch (Exception e) { |
| | | logger.error("导入失败 ", e); |
| | | return new ResponseEntity<String>("非常抱歉,您填写的模板数据有误:" + e.getMessage(), HttpStatus.BAD_REQUEST); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取业主车辆信息 |
| | | * |
| | | * @param workbook |
| | | * @param ownerCarDtos |
| | | */ |
| | | private void getOwnerCars(Workbook workbook, List<OwnerCarDto> ownerCarDtos) throws ParseException { |
| | | Sheet sheet = null; |
| | | sheet = ImportExcelUtils.getSheet(workbook, "业主车辆信息"); |
| | | List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet); |
| | | OwnerCarDto importOwnerCar = null; |
| | | for (int osIndex = 0; osIndex < oList.size(); osIndex++) { |
| | | Object[] os = oList.get(osIndex); |
| | | if (osIndex == 0 || osIndex == 1) { // 第一行是 头部信息 直接跳过 |
| | | continue; |
| | | } |
| | | if (StringUtil.isNullOrNone(os[0])) { |
| | | continue; |
| | | } |
| | | Assert.hasValue(os[0], (osIndex + 1) + "车牌号不能为空"); |
| | | Assert.hasValue(os[1], (osIndex + 1) + "房屋号不能为空"); |
| | | Assert.hasValue(os[2], (osIndex + 1) + "车辆品牌不能为空"); |
| | | Assert.hasValue(os[3], (osIndex + 1) + "车辆类型不能为空"); |
| | | Assert.hasValue(os[4], (osIndex + 1) + "颜色不能为空"); |
| | | Assert.hasValue(os[5], (osIndex + 1) + "业主不能为空"); |
| | | Assert.hasValue(os[6], (osIndex + 1) + "车位不能为空"); |
| | | Assert.hasValue(os[7], (osIndex + 1) + "起租时间不能为空"); |
| | | Assert.hasValue(os[8], (osIndex + 1) + "截止时间不能为空"); |
| | | Assert.hasValue(os[9], (osIndex + 1) + "停车场类型不能为空"); |
| | | Assert.hasValue(os[10], (osIndex + 1) + "车位类型不能为空"); |
| | | String startTime = excelDoubleToDate(os[7].toString()); |
| | | String endTime = excelDoubleToDate(os[8].toString()); |
| | | Assert.isDate(startTime, DateUtil.DATE_FORMATE_STRING_A, (osIndex + 1) + "行开始时间格式错误 请填写YYYY-MM-DD HH:mm:ss文本格式"); |
| | | Assert.isDate(endTime, DateUtil.DATE_FORMATE_STRING_A, (osIndex + 1) + "行结束时间格式错误 请填写YYYY-MM-DD HH:mm:ss文本格式"); |
| | | importOwnerCar = new OwnerCarDto(); |
| | | importOwnerCar.setCarNum(os[0].toString()); |
| | | importOwnerCar.setRoomName(os[1].toString()); |
| | | importOwnerCar.setCarBrand(os[2].toString()); |
| | | importOwnerCar.setCarType(os[3].toString()); |
| | | importOwnerCar.setCarColor(os[4].toString()); |
| | | importOwnerCar.setOwnerName(os[5].toString()); |
| | | //获取车位 |
| | | String parkingLot = os[6].toString(); |
| | | String[] split = parkingLot.split("-"); |
| | | importOwnerCar.setAreaNum(split[0]); |
| | | importOwnerCar.setNum(split[1]); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | importOwnerCar.setStartTime(simpleDateFormat.parse(startTime)); |
| | | importOwnerCar.setEndTime(simpleDateFormat.parse(endTime)); |
| | | importOwnerCar.setTypeCd(os[9].toString()); |
| | | importOwnerCar.setSpaceSate(os[10].toString()); |
| | | ownerCarDtos.add(importOwnerCar); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理ExcelData数据 |
| | | */ |
| | | private ResponseEntity<String> dealExcelData(IPageData pd, List<OwnerCarDto> ownerCarDtos, ComponentValidateResult result) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | //保存单元信息 和 楼栋信息 |
| | | responseEntity = savedOwnerCars(pd, ownerCarDtos, result); |
| | | if (responseEntity == null || responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | return responseEntity; |
| | | } |
| | | |
| | | private ResponseEntity<String> savedOwnerCars(IPageData pd, List<OwnerCarDto> ownerCars, ComponentValidateResult result) { |
| | | JSONObject reqJson = JSONObject.parseObject(pd.getReqData()); |
| | | if (ownerCars.size() < 1) { |
| | | throw new IllegalArgumentException("没有数据需要处理"); |
| | | } |
| | | for (OwnerCarDto ownerCarDto : ownerCars) { |
| | | OwnerCarPo ownerCarPo = BeanConvertUtil.covertBean(ownerCarDto, OwnerCarPo.class); |
| | | //获取房屋名称 |
| | | String roomName = ownerCarDto.getRoomName(); |
| | | String[] split = roomName.split("-"); |
| | | String floorNum = split[0]; |
| | | String unitNum = split[1]; |
| | | String roomNum = split[2]; |
| | | FloorDto floorDto = new FloorDto(); |
| | | floorDto.setCommunityId(reqJson.getString("communityId")); |
| | | floorDto.setFloorNum(floorNum); |
| | | //查询楼栋 |
| | | List<FloorDto> floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto); |
| | | Assert.listOnlyOne(floorDtos, "查询楼栋错误!"); |
| | | UnitDto unitDto = new UnitDto(); |
| | | unitDto.setUnitNum(unitNum); |
| | | unitDto.setFloorId(floorDtos.get(0).getFloorId()); |
| | | //查询单元 |
| | | List<UnitDto> unitDtos = unitInnerServiceSMOImpl.queryUnits(unitDto); |
| | | Assert.listOnlyOne(unitDtos, "查询单元错误!"); |
| | | RoomDto roomDto = new RoomDto(); |
| | | roomDto.setRoomNum(roomNum); |
| | | roomDto.setUnitId(unitDtos.get(0).getUnitId()); |
| | | //查询房屋 |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto); |
| | | Assert.listOnlyOne(roomDtos, "查询房屋错误!"); |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setRoomId(roomDtos.get(0).getRoomId()); |
| | | //查询业主房屋关系表 |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | Assert.listOnlyOne(ownerRoomRelDtos, "查询业主房屋信息错误!"); |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setOwnerId(ownerRoomRelDtos.get(0).getOwnerId()); |
| | | ownerDto.setName(ownerCarDto.getOwnerName()); |
| | | //查询业主 |
| | | List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto); |
| | | Assert.listOnlyOne(ownerDtos, "查询业主信息错误!"); |
| | | if (ownerDtos.get(0).getOwnerTypeCd().equals("1001")) { //业主 |
| | | ownerCarPo.setCarTypeCd("1001"); //业主车辆 |
| | | } else { |
| | | ownerCarPo.setCarTypeCd("1002"); //成员车辆 |
| | | } |
| | | ParkingAreaDto parkingAreaDto = new ParkingAreaDto(); |
| | | parkingAreaDto.setNum(ownerCarDto.getAreaNum()); |
| | | parkingAreaDto.setTypeCd(ownerCarDto.getTypeCd()); |
| | | //查询停车场 |
| | | List<ParkingAreaDto> parkingAreaDtos = parkingAreaInnerServiceSMOImpl.queryParkingAreas(parkingAreaDto); |
| | | Assert.listOnlyOne(parkingAreaDtos, "查询停车场错误!"); |
| | | ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto(); |
| | | parkingSpaceDto.setNum(ownerCarDto.getNum()); |
| | | parkingSpaceDto.setPaId(parkingAreaDtos.get(0).getPaId()); |
| | | //查询停车位 |
| | | List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto); |
| | | Assert.listOnlyOne(parkingSpaceDtos, "查询停车位错误!"); |
| | | //获取停车位状态(出售 S,出租 H ,空闲 F) |
| | | String state = parkingSpaceDtos.get(0).getState(); |
| | | if (!StringUtil.isEmpty(state) && !state.equals("F")) { |
| | | throw new IllegalArgumentException(parkingAreaDtos.get(0).getNum() + "停车场-" + parkingSpaceDtos.get(0).getNum() + "停车位不是空闲状态!"); |
| | | } |
| | | ownerCarPo.setPsId(parkingSpaceDtos.get(0).getPsId()); |
| | | ownerCarPo.setOwnerId(ownerRoomRelDtos.get(0).getOwnerId()); |
| | | ownerCarPo.setUserId("-1"); |
| | | ownerCarPo.setCommunityId(reqJson.getString("communityId")); |
| | | ownerCarPo.setCarId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_carId)); |
| | | ownerCarPo.setMemberId(ownerCarPo.getCarId()); |
| | | ownerCarPo.setState("1001"); //1001 正常状态,2002 车位释放欠费状态,3003 车位释放 |
| | | ownerCarV1InnerServiceSMOImpl.saveOwnerCar(ownerCarPo); |
| | | ParkingSpacePo parkingSpacePo = new ParkingSpacePo(); |
| | | parkingSpacePo.setPsId(parkingSpaceDtos.get(0).getPsId()); //车位id |
| | | parkingSpacePo.setState(ownerCarDto.getSpaceSate()); |
| | | parkingSpaceInnerServiceSMOImpl.updateParkingSpace(parkingSpacePo); |
| | | } |
| | | return ResultVo.success(); |
| | | } |
| | | |
| | | //解析Excel日期格式 |
| | | public static String excelDoubleToDate(String strDate) { |
| | | if (strDate.length() == 5) { |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date tDate = DoubleToDate(Double.parseDouble(strDate)); |
| | | return sdf.format(tDate); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return strDate; |
| | | } |
| | | } |
| | | return strDate; |
| | | } |
| | | |
| | | //解析Excel日期格式 |
| | | public static Date DoubleToDate(Double dVal) { |
| | | Date tDate = new Date(); |
| | | long localOffset = tDate.getTimezoneOffset() * 60000; //系统时区偏移 1900/1/1 到 1970/1/1 的 25569 天 |
| | | tDate.setTime((long) ((dVal - 25569) * 24 * 3600 * 1000 + localOffset)); |
| | | return tDate; |
| | | } |
| | | } |
| | |
| | | @RequestParam(value = "personTel", required = false) String personTel, |
| | | @RequestParam(value = "state", required = false) String state, |
| | | @RequestParam(value = "isPostpone", required = false) String isPostpone, |
| | | @RequestParam(value = "renovationTime", required = false) String renovationTime, |
| | | @RequestParam(value = "renovationStartTime", required = false) String renovationStartTime, |
| | | @RequestParam(value = "renovationEndTime", required = false) String renovationEndTime, |
| | | @RequestHeader(value = "user-id") String userId, |
| | | @RequestParam(value = "page", required = false) int page, |
| | | @RequestParam(value = "row", required = false) int row) { |
| | |
| | | roomRenovationDto.setState(state); |
| | | roomRenovationDto.setUserId(userId); |
| | | roomRenovationDto.setIsPostpone(isPostpone); |
| | | roomRenovationDto.setRenovationTime(renovationTime); |
| | | roomRenovationDto.setRenovationStartTime(renovationStartTime); |
| | | roomRenovationDto.setRenovationEndTime(renovationEndTime); |
| | | return getRoomRenovationBMOImpl.get(roomRenovationDto); |
| | | } |
| | | |
| | |
| | | businessRepairSettingInfo.put("newBId", businessRepairSettingInfo.get("b_id")); |
| | | businessRepairSettingInfo.put("operate", businessRepairSettingInfo.get("operate")); |
| | | businessRepairSettingInfo.put("repairTypeName", businessRepairSettingInfo.get("repair_type_name")); |
| | | businessRepairSettingInfo.put("repairType", businessRepairSettingInfo.get("repair_type")); |
| | | businessRepairSettingInfo.put("repairSettingType", businessRepairSettingInfo.get("repair_setting_type")); |
| | | businessRepairSettingInfo.put("settingType", businessRepairSettingInfo.get("setting_type")); |
| | | businessRepairSettingInfo.put("remark", businessRepairSettingInfo.get("remark")); |
| | | businessRepairSettingInfo.put("communityId", businessRepairSettingInfo.get("community_id")); |
| | | businessRepairSettingInfo.put("repairWay", businessRepairSettingInfo.get("repair_way")); |
| | |
| | | currentRepairSettingInfo.put("operate", currentRepairSettingInfo.get("operate")); |
| | | currentRepairSettingInfo.put("repairTypeName", currentRepairSettingInfo.get("repair_type_name")); |
| | | currentRepairSettingInfo.put("repairType", currentRepairSettingInfo.get("repair_type")); |
| | | currentRepairSettingInfo.put("repairSettingType", currentRepairSettingInfo.get("repair_setting_type")); |
| | | currentRepairSettingInfo.put("remark", currentRepairSettingInfo.get("remark")); |
| | | currentRepairSettingInfo.put("communityId", currentRepairSettingInfo.get("community_id")); |
| | | currentRepairSettingInfo.put("repairWay", currentRepairSettingInfo.get("repair_way")); |
| | |
| | | businessResourceStoreUseRecordInfo.put("operate", businessResourceStoreUseRecordInfo.get("operate")); |
| | | businessResourceStoreUseRecordInfo.put("communityId", businessResourceStoreUseRecordInfo.get("community_id")); |
| | | businessResourceStoreUseRecordInfo.put("resourceStoreName", businessResourceStoreUseRecordInfo.get("resource_store_name")); |
| | | businessResourceStoreUseRecordInfo.put("state", businessResourceStoreUseRecordInfo.get("state")); |
| | | businessResourceStoreUseRecordInfo.remove("bId"); |
| | | businessResourceStoreUseRecordInfo.put("statusCd", statusCd); |
| | | } |
| | |
| | | currentResourceStoreUseRecordInfo.put("operate", currentResourceStoreUseRecordInfo.get("operate")); |
| | | currentResourceStoreUseRecordInfo.put("communityId", currentResourceStoreUseRecordInfo.get("community_id")); |
| | | currentResourceStoreUseRecordInfo.put("resourceStoreName", currentResourceStoreUseRecordInfo.get("resource_store_name")); |
| | | currentResourceStoreUseRecordInfo.put("state", currentResourceStoreUseRecordInfo.get("state")); |
| | | currentResourceStoreUseRecordInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getResourceStoreUseRecordServiceDaoImpl().saveBusinessResourceStoreUseRecordInfo(currentResourceStoreUseRecordInfo); |
| | | for (Object key : currentResourceStoreUseRecordInfo.keySet()) { |
| | |
| | | */ |
| | | package com.java110.user.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.user.dao.IOwnerCarV1ServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(OwnerCarV1ServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存车辆信息 到 instance |
| | | * @param info bId 信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public int saveOwnerCarInfo(Map info) throws DAOException { |
| | | logger.debug("保存 saveOwnerCarInfo 入参 info : {}",info); |
| | | logger.debug("保存 saveOwnerCarInfo 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("ownerCarV1ServiceDaoImpl.saveOwnerCarInfo",info); |
| | | int saveFlag = sqlSessionTemplate.insert("ownerCarV1ServiceDaoImpl.saveOwnerCarInfo", info); |
| | | |
| | | return saveFlag; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询车辆信息(instance) |
| | | * |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getOwnerCarInfo(Map info) throws DAOException { |
| | | logger.debug("查询 getOwnerCarInfo 入参 info : {}",info); |
| | | logger.debug("查询 getOwnerCarInfo 入参 info : {}", info); |
| | | |
| | | List<Map> businessOwnerCarInfos = sqlSessionTemplate.selectList("ownerCarV1ServiceDaoImpl.getOwnerCarInfo",info); |
| | | List<Map> businessOwnerCarInfos = sqlSessionTemplate.selectList("ownerCarV1ServiceDaoImpl.getOwnerCarInfo", info); |
| | | |
| | | return businessOwnerCarInfos; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 修改车辆信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public int updateOwnerCarInfo(Map info) throws DAOException { |
| | | logger.debug("修改 updateOwnerCarInfo 入参 info : {}",info); |
| | | logger.debug("修改 updateOwnerCarInfo 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("ownerCarV1ServiceDaoImpl.updateOwnerCarInfo",info); |
| | | int saveFlag = sqlSessionTemplate.update("ownerCarV1ServiceDaoImpl.updateOwnerCarInfo", info); |
| | | |
| | | return saveFlag; |
| | | } |
| | | |
| | | /** |
| | | /** |
| | | * 查询车辆数量 |
| | | * |
| | | * @param info 车辆信息 |
| | | * @return 车辆数量 |
| | | */ |
| | | @Override |
| | | public int queryOwnerCarsCount(Map info) { |
| | | logger.debug("查询 queryOwnerCarsCount 入参 info : {}",info); |
| | | logger.debug("查询 queryOwnerCarsCount 入参 info : {}", info); |
| | | |
| | | List<Map> businessOwnerCarInfos = sqlSessionTemplate.selectList("ownerCarV1ServiceDaoImpl.queryOwnerCarsCount", info); |
| | | if (businessOwnerCarInfos.size() < 1) { |