flower_city/src/main/java/com/dg/core/db/gen/mapper/OrganizationChartMapper.java
@@ -64,7 +64,7 @@ /** * 根据所属地区查找部门 */ List<OrganizationChartEntity> selectByCode(@Param("id")String id, @Param("areaCode") String areaCode); List<OrganizationChartEntity> selectByCode(@Param("id")String id, @Param("areaCode") String areaCode,@Param("grade") Integer grade); flower_city/src/main/java/com/dg/core/service/impl/GuideRepairOrderServiceImpl.java
@@ -51,6 +51,10 @@ @Resource private AreaCode2022Mapper areaCode2022Mapper; @Resource SmsUtil smsUtil; @Resource(name = "stringRedisTemplate") @@ -84,8 +88,13 @@ } } if (isAdd) { AreaCode2022 areaCode2022 = areaCode2022Mapper.selectOne(new QueryWrapper<AreaCode2022>().lambda().eq(AreaCode2022::getCode, guideRepairOrder.getAreaCode())); Integer grade=2; if (areaCode2022.getLevel()==2){ grade=1; } //自动分配业务代码开始 List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectByCode(transactionEvent.getDepartmentId(), guideRepairOrder.getAreaCode()); List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectByCode(transactionEvent.getDepartmentId(), guideRepairOrder.getAreaCode(),grade); if (organizationChartEntities.size() > 0) { for (OrganizationChartEntity organizationChart : organizationChartEntities) { departmentIds.add(organizationChart.getId().toString()); flower_city/src/main/java/com/dg/core/util/SmsUtil.java
@@ -23,6 +23,7 @@ import javax.annotation.Resource; import java.io.IOException; import java.time.LocalDateTime; import java.util.HashMap; import java.util.Map; import java.util.Random; @@ -376,7 +377,7 @@ String url = "https://dxsdk.028lk.com:8082/Api/SendSms?"+"LoginName="+LoginName+"&Pwd="+Pwd+"&FeeType="+FeeType+"&Mobile="+tel+"&Content="; Random rd = new Random(); String content="您有新的导办工单,请"+name+"尽快处理。"; String content="您在"+ LocalDateTime.now() +"新的导办工单,请"+name+"尽快处理。"; url=url+content; OkHttpClient client = new OkHttpClient(); Response response; flower_city/src/main/resources/mapper/OrganizationChartMapper.xml
@@ -110,8 +110,9 @@ <select id="selectByCode" resultMap="OrganizationChartResult"> <include refid="selectOrganizationChartVo"/> <where> ( id=#{id} or parent_id=#{id}) and (city=#{areaCode} or district= #{areaCode} or village=#{areaCode}) ( id=#{id} or parent_id=#{id}) and (city=#{areaCode} or district= #{areaCode} or village=#{areaCode}) and grade=#{grade} </where> order by grade </select> <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.OrganizationChartEntity">