调整处罚短信接口逻辑

separationdemo
zhaoyu 2023-11-16 17:20:16 +08:00
parent d1600cd7ce
commit 8e5325bd17
5 changed files with 73 additions and 1 deletions

View File

@ -85,8 +85,9 @@ public class AppKeyprojectCheckController extends BaseController {
time = DateUtil.calculateDateSecond(time, 1);
}
}
Boolean boo = false; // 增加开关控制
if (Tools.notEmpty(pd.getString("HIDDENJSON"))) {
boo = true;
List<PageData> hiddenList = new ArrayList<PageData>();
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("HIDDENJSON"));
String time = currentTime;
@ -142,6 +143,32 @@ public class AppKeyprojectCheckController extends BaseController {
records = SendSmsUtil.getRecords(person.getString("PHONENUM"),tpContent);
jsonArray.add(records);
SendSmsUtil.sendSms("121451",jsonArray,null);
//发送罚款待处理 上文开关控制这里发送不
if(boo){
List<JSONObject> jsonList = (List<JSONObject>) JSON.parse(pd.getString("HIDDENJSON"));
String PUNISHTHEPERSON = keyprojectHiddenService.getPUNISHTHEPERSON(pd);
if (!Tools.isEmpty(PUNISHTHEPERSON)) {
PageData selectPageData = new PageData();
String[] split = PUNISHTHEPERSON.split(",");
selectPageData.put("ids", split);
List<String> list = keyprojectHiddenService.getPhone(selectPageData);
for (JSONObject json : jsonList) {
for(String phone:list) {
JSONArray jsonBrray = new JSONArray();
//接受返回结果
JSONObject recordsB = new JSONObject();
//定义替换参数
JSONObject tpContentB = new JSONObject();
tpContentB.put("HIDDENDESCR",json.getString("HIDDENDESCR")); //隐患描述
if(StringUtils.isNotBlank(phone)){
recordsB = SendSmsUtil.getRecords(phone,tpContentB);
jsonBrray.add(recordsB);
SendSmsUtil.sendSms("121487",jsonBrray,null);
}
}
}
}
}
}
}catch (Exception e){
e.printStackTrace();

View File

@ -158,5 +158,14 @@ public interface KeyprojectHiddenMapper {
*/
List<PageData> getpunishlistPage(Page page);
/**
*
* @param pd
* @return
*/
String getPUNISHTHEPERSON(PageData pd);
List<String> getPhone(PageData pd);
}

View File

@ -180,5 +180,14 @@ public interface KeyprojectHiddenService {
public PageData keyprojectcount(PageData pd)throws Exception;
List<PageData> getpunishlist(Page page);
/**
*
* @param pd
* @return
*/
String getPUNISHTHEPERSON(PageData pd);
List<String> getPhone(PageData pd);
}

View File

@ -253,5 +253,15 @@ public class KeyprojectHiddenServiceImpl implements KeyprojectHiddenService {
public List<PageData> getpunishlist(Page page) {
return hiddenMapper.getpunishlistPage(page);
}
@Override
public String getPUNISHTHEPERSON(PageData pd) {
return hiddenMapper.getPUNISHTHEPERSON(pd);
}
@Override
public List<String> getPhone(PageData pd) {
return hiddenMapper.getPhone(pd);
}
}

View File

@ -1606,4 +1606,21 @@
h.ISPUNISH ASC,
p.HANDLED DESC
</select>
<select id="getPUNISHTHEPERSON" parameterType="pd" resultType="string">
SELECT gc.PUNISH_THE_PERSON PUNISH_THE_PERSON FROM `qa-gwj-regulatory`.BUS_OUTSOURCED gc
WHERE gc.OUTSOURCED_ID=#{OUTSOURCED_ID}
AND gc.IS_SMS = '0'
</select>
<select id="getPhone" parameterType="pd" resultType="string">
SELECT
IFNULL(PHONE,USERNAME) PHONE FROM vi_user_all WHERE
<if test="ids!= null and ids.length>0">
USER_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>