xiaogang
2022-08-11 b06ccd76e50812d81ee689dcd609bb02ac5c4ed4
service-report/src/main/java/com/java110/report/api/ReportInfoSettingTitleApi.java
@@ -11,6 +11,7 @@
import com.java110.report.bmo.reportInfoSettingTitle.IUpdateReportInfoSettingTitleBMO;
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.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@@ -31,10 +32,11 @@
    /**
     * 微信保存消息模板
     * @serviceCode /reportInfoSettingTitle/saveReportInfoSettingTitle
     * @path /app/reportInfoSettingTitle/saveReportInfoSettingTitle
     *
     * @param reqJson
     * @return
     * @serviceCode /reportInfoSettingTitle/saveReportInfoSettingTitle
     * @path /app/reportInfoSettingTitle/saveReportInfoSettingTitle
     */
    @RequestMapping(value = "/saveReportInfoSettingTitle", method = RequestMethod.POST)
    public ResponseEntity<String> saveReportInfoSettingTitle(@RequestBody JSONObject reqJson) {
@@ -47,9 +49,14 @@
        JSONArray titleValues = null;
        if (!ReportInfoSettingTitleDto.TITLE_TYPE_QUESTIONS.equals(reqJson.getString("titleType"))) {
            titleValues = reqJson.getJSONArray("titleValues");
            if (titleValues.size() < 1) {
                throw new IllegalArgumentException("未包含选项");
            }
            for (int index = 0; index < titleValues.size(); index++) {
                JSONObject param = titleValues.getJSONObject(index);
                if (StringUtil.isEmpty(param.getString("qaValue"))) {
                    throw new IllegalArgumentException("题目选项不能为空");
                }
            }
        }
@@ -59,14 +66,14 @@
    /**
     * 微信修改消息模板
     * @serviceCode /reportInfoSettingTitle/updateSettingTitle
     * @path /app/reportInfoSettingTitle/updateReportInfoSettingTitle
     *
     * @param reqJson
     * @return
     * @serviceCode /reportInfoSettingTitle/updateSettingTitle
     * @path /app/reportInfoSettingTitle/updateSettingTitle
     */
    @RequestMapping(value = "/updateSettingTitle", method = RequestMethod.POST)
    public ResponseEntity<String> updateReportInfoSettingTitle(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "titleId", "请求报文中未包含titleId");
        Assert.hasKeyAndValue(reqJson, "settingId", "请求报文中未包含settingId");
        Assert.hasKeyAndValue(reqJson, "title", "请求报文中未包含title");
@@ -76,9 +83,14 @@
        JSONArray titleValues = null;
        if (!ReportInfoSettingTitleDto.TITLE_TYPE_QUESTIONS.equals(reqJson.getString("titleType"))) {
            titleValues = reqJson.getJSONArray("titleValues");
            if (titleValues.size() < 1) {
                throw new IllegalArgumentException("未包含选项");
            }
            for (int index = 0; index < titleValues.size(); index++) {
                JSONObject param = titleValues.getJSONObject(index);
                if (StringUtil.isEmpty(param.getString("qaValue"))) {
                    throw new IllegalArgumentException("题目选项不能为空");
                }
            }
        }
@@ -90,10 +102,11 @@
    /**
     * 微信删除消息模板
     * @serviceCode /reportInfoSettingTitle/deleteSettingTitle
     * @path /app/reportInfoSettingTitle/deleteReportInfoSettingTitle
     *
     * @param reqJson
     * @return
     * @serviceCode /reportInfoSettingTitle/deleteSettingTitle
     * @path /app/reportInfoSettingTitle/deleteReportInfoSettingTitle
     */
    @RequestMapping(value = "/deleteSettingTitle", method = RequestMethod.POST)
    public ResponseEntity<String> deleteReportInfoSettingTitle(@RequestBody JSONObject reqJson) {
@@ -108,10 +121,11 @@
    /**
     * 微信删除消息模板
     * @serviceCode /reportInfoSettingTitle/querySettingTitle
     * @path /app/reportInfoSettingTitle/queryReportInfoSettingTitle
     *
     * @param communityId 小区ID
     * @return
     * @serviceCode /reportInfoSettingTitle/querySettingTitle
     * @path /app/reportInfoSettingTitle/queryReportInfoSettingTitle
     */
    @RequestMapping(value = "/querySettingTitle", method = RequestMethod.GET)
    public ResponseEntity<String> queryReportInfoSettingTitle(@RequestParam(value = "communityId") String communityId,