wuxw
2024-02-27 be272a1222541a2b040d4f6a1df96f4906fca5fb
优化代码
10个文件已修改
114 ■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/repair/RepairDto.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/repair/RepairSettingDto.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/repair/RepairSettingPo.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/RepairServiceDaoImplMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/RepairSettingServiceDaoImplMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/RepairSettingV1ServiceDaoImplMapper.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/dao/impl/RepairServiceDaoImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/dao/impl/RepairSettingServiceDaoImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/smo/impl/RepairSettingInnerServiceSMOImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/Repair/MachineAddOwnerRepairAdapt.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/repair/RepairDto.java
@@ -129,6 +129,8 @@
    private String startTime;
    private String endTime;
    private String notifyWay;
    public String getRepairName() {
        return repairName;
@@ -570,4 +572,12 @@
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
    public String getNotifyWay() {
        return notifyWay;
    }
    public void setNotifyWay(String notifyWay) {
        this.notifyWay = notifyWay;
    }
}
java110-bean/src/main/java/com/java110/dto/repair/RepairSettingDto.java
@@ -14,6 +14,9 @@
 * add by wuxw 2019/4/24
 **/
public class RepairSettingDto extends PageDto implements Serializable {
    public static final String NOTIFY_WAY_SMS = "SMS"; //短信
    public static final String NOTIFY_WAY_WECHAT = "WECHAT"; //微信
    private String repairTypeName;
    private String repairType;
    private String remark;
@@ -31,6 +34,8 @@
    private Date createTime;
    private String statusCd = "0";
    private String isShow;
    private String notifyWay;
    public String getRepairTypeName() {
        return repairTypeName;
@@ -167,4 +172,12 @@
    public void setIsShow(String isShow) {
        this.isShow = isShow;
    }
    public String getNotifyWay() {
        return notifyWay;
    }
    public void setNotifyWay(String notifyWay) {
        this.notifyWay = notifyWay;
    }
}
java110-bean/src/main/java/com/java110/po/repair/RepairSettingPo.java
@@ -17,6 +17,8 @@
    private String statusCd = "0";
    private String isShow;
    private String notifyWay;
    public String getRepairTypeName() {
        return repairTypeName;
    }
@@ -120,4 +122,12 @@
    public void setIsShow(String isShow) {
        this.isShow = isShow;
    }
    public String getNotifyWay() {
        return notifyWay;
    }
    public void setNotifyWay(String notifyWay) {
        this.notifyWay = notifyWay;
    }
}
java110-db/src/main/resources/mapper/community/RepairServiceDaoImplMapper.xml
@@ -132,14 +132,14 @@
    <select id="getRepairInfo" parameterType="Map" resultType="Map">
        select t.repair_name,t.repair_name repairName,t.appointment_time,t.appointment_time
        appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id
        repairId,t.tel,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id
        repairId,t.tel,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id
        bId, d.name stateName,t.maintenance_type maintenanceType,t.repair_channel repairChannel,
        t.repair_materials,t.repair_materials repairMaterials,t.repair_fee,t.repair_fee repairFee,
        rs.repair_type_name repairTypeName,rs.repair_way repairWay,rs.return_visit_flag returnVisitFlag,
        t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_obj_type repairObjType,t.repair_obj_id repairObjId,
        t.repair_obj_name repairObjName,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,rs.repair_setting_type repairSettingType,d1.name repairSettingTypeName,t.create_time createTime
        t.pay_type,t.pay_type payType,rs.repair_setting_type repairSettingType,rs.notify_way notifyWay,d1.name repairSettingTypeName,t.create_time createTime
        <if test="staffId != null and staffId != ''">
            ,rru.state repairDispatchState,rru.context repairDispatchContext,td.name repairDispatchStateName
        </if>
java110-db/src/main/resources/mapper/community/RepairSettingServiceDaoImplMapper.xml
@@ -103,7 +103,7 @@
        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,t.is_show,t.is_show isShow
        returnVisitFlagName,t.is_show,t.is_show isShow,t.notify_way notifyWay
        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'
@@ -117,6 +117,9 @@
        </if>
        <if test="repairType !=null and repairType != ''">
            and t.repair_type= #{repairType}
        </if>
        <if test="notifyWay !=null and notifyWay != ''">
            and t.notify_way= #{notifyWay}
        </if>
        <if test="repairSettingType !=null and repairSettingType != ''">
            and t.repair_setting_type= #{repairSettingType}
@@ -175,9 +178,7 @@
        <if test="remark !=null and remark != ''">
            , t.remark= #{remark}
        </if>
        <if test="communityId !=null and communityId != ''">
            , t.community_id= #{communityId}
        </if>
        <if test="repairWay !=null and repairWay != ''">
            , t.repair_way= #{repairWay}
        </if>
@@ -196,12 +197,18 @@
        <if test="isShow !=null and isShow != ''">
            , t.is_show= #{isShow}
        </if>
        <if test="notifyWay !=null and notifyWay != ''">
            , t.notify_way= #{notifyWay}
        </if>
        where 1=1
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="settingId !=null and settingId != ''">
            and t.setting_id= #{settingId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </update>
@@ -251,5 +258,8 @@
        <if test="isShow !=null and isShow != ''">
            and t.is_show= #{isShow}
        </if>
        <if test="notifyWay !=null and notifyWay != ''">
            and t.notify_way= #{notifyWay}
        </if>
    </select>
</mapper>
java110-db/src/main/resources/mapper/community/RepairSettingV1ServiceDaoImplMapper.xml
@@ -7,22 +7,24 @@
    <insert id="saveRepairSettingInfo" parameterType="Map">
        insert into r_repair_setting(price_scope, pay_fee_flag, return_visit_flag, repair_type_name, repair_type,
                                     remark, community_id, public_area, repair_way, repair_setting_type, setting_id,
                                     is_show)
                                     is_show,notify_way)
        values (#{priceScope}, #{payFeeFlag}, #{returnVisitFlag}, #{repairTypeName}, #{repairType}, #{remark},
                #{communityId}, #{publicArea}, #{repairWay}, #{repairSettingType}, #{settingId}, #{isShow})
                #{communityId}, #{publicArea}, #{repairWay}, #{repairSettingType}, #{settingId}, #{isShow},#{notifyWay})
    </insert>
    <!-- 查询报修设置信息 add by wuxw 2018-07-03 -->
    <select id="getRepairSettingInfo" parameterType="Map" resultType="Map">
        select t.price_scope,t.price_scope priceScope,t.pay_fee_flag,t.pay_fee_flag
        payFeeFlag,t.return_visit_flag,t.return_visit_flag returnVisitFlag,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.community_id,t.community_id communityId,t.public_area,t.public_area
        publicArea,t.repair_way,t.repair_way repairWay,t.repair_setting_type,t.repair_setting_type
        repairSettingType,t.setting_id,t.setting_id settingId,t.is_show,t.is_show isShow
        select t.price_scope priceScope,t.pay_fee_flag
        payFeeFlag,t.return_visit_flag returnVisitFlag,t.repair_type_name
        repairTypeName,t.repair_type repairType,t.remark,t.status_cd
        statusCd,t.community_id communityId,t.public_area publicArea,t.repair_way repairWay,t.repair_setting_type
        repairSettingType,t.setting_id settingId,t.is_show isShow,t.notify_way notifyWay
        from r_repair_setting t
        where 1 =1
        <if test="priceScope !=null and priceScope != ''">
            and t.price_scope= #{priceScope}
        </if>
        <if test="notifyWay !=null and notifyWay != ''">
            and t.notify_way= #{notifyWay}
        </if>
        <if test="payFeeFlag !=null and payFeeFlag != ''">
            and t.pay_fee_flag= #{payFeeFlag}
@@ -90,9 +92,7 @@
        <if test="remark !=null and remark != ''">
            , t.remark= #{remark}
        </if>
        <if test="communityId !=null and communityId != ''">
            , t.community_id= #{communityId}
        </if>
        <if test="publicArea !=null and publicArea != ''">
            , t.public_area= #{publicArea}
        </if>
@@ -105,9 +105,15 @@
        <if test="isShow !=null and isShow != ''">
            , t.is_show= #{isShow}
        </if>
        <if test="notifyWay !=null and notifyWay != ''">
            , t.notify_way= #{notifyWay}
        </if>
        where 1=1
        <if test="settingId !=null and settingId != ''">
            and t.setting_id= #{settingId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </update>
@@ -155,5 +161,8 @@
        <if test="isShow !=null and isShow != ''">
            and t.is_show= #{isShow}
        </if>
        <if test="notifyWay !=null and notifyWay != ''">
            and t.notify_way= #{notifyWay}
        </if>
    </select>
</mapper>
service-community/src/main/java/com/java110/community/dao/impl/RepairServiceDaoImpl.java
@@ -79,8 +79,8 @@
    @Override
    public List<Map> getRepairInfo(Map info) throws DAOException {
        logger.debug("查询报修信息信息 入参 info : {}", info);
        List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getRepairInfo", info);
        return businessRepairInfos;
        List<Map> infos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getRepairInfo", info);
        return infos;
    }
    /**
service-community/src/main/java/com/java110/community/dao/impl/RepairSettingServiceDaoImpl.java
@@ -89,9 +89,9 @@
    public List<Map> getRepairSettingInfo(Map info) throws DAOException {
        logger.debug("查询报修设置信息 入参 info : {}", info);
        List<Map> businessRepairSettingInfos = sqlSessionTemplate.selectList("repairSettingServiceDaoImpl.getRepairSettingInfo", info);
        List<Map> infos = sqlSessionTemplate.selectList("repairSettingServiceDaoImpl.getRepairSettingInfo", info);
        return businessRepairSettingInfos;
        return infos;
    }
service-community/src/main/java/com/java110/community/smo/impl/RepairSettingInnerServiceSMOImpl.java
@@ -9,6 +9,7 @@
import com.java110.intf.community.IRepairSettingInnerServiceSMO;
import com.java110.intf.user.IUserInnerServiceSMO;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.ListUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@@ -46,7 +47,7 @@
        List<RepairSettingDto> repairSettings = BeanConvertUtil.covertBeanList(repairSettingServiceDaoImpl.getRepairSettingInfo(BeanConvertUtil.beanCovertMap(repairSettingDto)), RepairSettingDto.class);
        if (repairSettings == null || repairSettings.size() == 0) {
        if (ListUtil.isNull(repairSettings)) {
            return repairSettings;
        }
service-job/src/main/java/com/java110/job/adapt/Repair/MachineAddOwnerRepairAdapt.java
@@ -5,9 +5,11 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.core.factory.WechatFactory;
import com.java110.dto.community.CommunityMemberDto;
import com.java110.dto.complaintType.ComplaintTypeDto;
import com.java110.dto.privilege.BasePrivilegeDto;
import com.java110.dto.community.CommunityDto;
import com.java110.dto.repair.RepairDto;
import com.java110.dto.repair.RepairSettingDto;
import com.java110.dto.wechat.SmallWeChatDto;
import com.java110.dto.wechat.SmallWechatAttrDto;
import com.java110.dto.user.StaffAppAuthDto;
@@ -23,6 +25,7 @@
import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
import com.java110.job.adapt.DatabusAdaptImpl;
import com.java110.job.msgNotify.IMsgNotify;
import com.java110.job.msgNotify.MsgNotifyFactory;
import com.java110.po.owner.RepairPoolPo;
import com.java110.utils.cache.MappingCache;
@@ -115,7 +118,7 @@
        paramIn.put("context", context);
        paramIn.put("repairName", repairName);
        paramIn.put("repairId", repairDtos.get(0).getRepairId());
        sendMessage(paramIn, communityDtos.get(0));
        sendMessage(paramIn, communityDtos.get(0),repairDtos.get(0));
    }
    /**
@@ -124,7 +127,7 @@
     * @param paramIn
     * @param communityDto
     */
    private void sendMessage(JSONObject paramIn, CommunityDto communityDto) {
    private void sendMessage(JSONObject paramIn, CommunityDto communityDto,RepairDto repairDto) {
        //查询小区物业公司
        CommunityMemberDto communityMemberDto = new CommunityMemberDto();
@@ -140,6 +143,14 @@
        basePrivilegeDto.setCommunityId(communityMemberDtos.get(0).getCommunityId());
        List<UserDto> userDtos = privilegeInnerServiceSMO.queryPrivilegeUsers(basePrivilegeDto);
        List<String> userIds = new ArrayList<>();
        IMsgNotify msgNotify = null;
        if(RepairSettingDto.NOTIFY_WAY_SMS.equals(repairDto.getNotifyWay())) {
            msgNotify = MsgNotifyFactory.getMsgNotify(MsgNotifyFactory.NOTIFY_WAY_ALI);
        }else if(RepairSettingDto.NOTIFY_WAY_WECHAT.equals(repairDto.getNotifyWay())){
            msgNotify = MsgNotifyFactory.getMsgNotify(MsgNotifyFactory.NOTIFY_WAY_WECHAT);
        }else{
            return;
        }
        for (UserDto userDto : userDtos) {
            if (userIds.contains(userDto.getUserId())) {
                continue;
@@ -157,7 +168,7 @@
            String wechatUrl = MappingCache.getValue(MappingConstant.URL_DOMAIN,"STAFF_WECHAT_URL");
            content.put("url",wechatUrl);
            MsgNotifyFactory.sendAddOwnerRepairMsg(communityDto.getCommunityId(),userDto.getUserId(),content);
            msgNotify.sendAddOwnerRepairMsg(communityDto.getCommunityId(),userDto.getUserId(),content);
        }
    }
}