forked from integrated_whb/integrated_whb
隐患排查添加导入
parent
741d2f1077
commit
4f9ca7c9c9
|
@ -100,11 +100,7 @@ public class CustomController extends BaseController {
|
|||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
String listPeriod = pd.getString("PERIOD");
|
||||
if (pd.get("USER_IDS") != null && Tools.notEmpty(pd.get("USER_IDS").toString())) {
|
||||
String[] userIds = pd.get("USER_IDS").toString().split(",");
|
||||
for (int i = 0; i < userIds.length; i++) {
|
||||
pd.put("CUSTOM_ID", this.get32UUID()); //主键
|
||||
pd.put("USER_ID", userIds[i]);
|
||||
if (pd.get("LISTITEM") != null && !pd.get("LISTITEM").equals("")) {
|
||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("LISTITEM").toString());
|
||||
for (JSONObject json : list) {
|
||||
|
@ -301,10 +297,8 @@ public class CustomController extends BaseController {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
@ -322,13 +316,49 @@ public class CustomController extends BaseController {
|
|||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
PageData npd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
npd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
npd.put("ISMAIN", Jurisdiction.getIS_MAIN());
|
||||
npd.put("ISSUPERVISE", Jurisdiction.getISSUPERVISE());
|
||||
npd.put("DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID());
|
||||
pd.put("USER_ID",Jurisdiction.getUSER_ID());
|
||||
String DEPTIDS = pd.getString("DEPTIDS");
|
||||
if(Tools.notEmpty(DEPTIDS)) {
|
||||
String DEPT_IDS[] = DEPTIDS.split(",");
|
||||
npd.put("DEPT_IDS", DEPT_IDS);
|
||||
}
|
||||
npd.put("HIDFORBIDDEN", "no"); //企业
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
page.setPd(pd);
|
||||
if(Tools.notEmpty(KEYWORDS))npd.put("KEYWORDS", KEYWORDS.trim());
|
||||
String USERNAME = pd.getString("USERNAME"); //关键词检索条件
|
||||
if(Tools.notEmpty(USERNAME))npd.put("USERNAME", USERNAME.trim());
|
||||
PageData cpd = usersService.findById(pd);
|
||||
npd.put("ISLEADER", cpd.getString("ISLEADER"));
|
||||
if(cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")){
|
||||
String DEPARTMENT_ID = npd.getString("DEPARTMENT_ID");
|
||||
String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID);
|
||||
ids=npd.getString("DEPARTMENT_ID")+","+ids; //把自己部门插入进去
|
||||
if(ids!=null && Tools.notEmpty(ids)&& ids.lastIndexOf(",")>-1) {
|
||||
ids = ids.substring(0,ids.lastIndexOf(","));
|
||||
npd.put("DEPARTMENT_IDS", ids.split(","));
|
||||
}else {
|
||||
npd.put("DEPARTMENT_IDS", DEPARTMENT_ID);
|
||||
}
|
||||
}else{
|
||||
if(npd.getString("ISMAIN").equals("0") ){
|
||||
npd.put("USER_ID",Jurisdiction.getUSER_ID());
|
||||
}
|
||||
}
|
||||
npd.put("TYPE",pd.getString("TYPE"));
|
||||
npd.put("LISTINGLEVEL",pd.getString("LISTINGLEVEL"));
|
||||
npd.put("RISKCHECKLISTTYPE",pd.getString("RISKCHECKLISTTYPE"));
|
||||
npd.put("POST_ID",pd.getString("POST_ID"));
|
||||
npd.put("PERIOD",pd.getString("PERIOD"));
|
||||
page.setPd(npd);
|
||||
List<PageData> varList = customService.list(page);
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
@ -374,7 +404,7 @@ public class CustomController extends BaseController {
|
|||
pd.put("ENDTIME", pd.get("END_DATE").toString() + " 23:59:59");
|
||||
pd.put("PERIOD", null);
|
||||
PageData statistics = customStatisticsService.findByCondition(pd);
|
||||
if (statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
|
||||
if (statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) {
|
||||
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString()) - 2);
|
||||
customStatisticsService.edit(statistics);
|
||||
}
|
||||
|
@ -447,7 +477,7 @@ public class CustomController extends BaseController {
|
|||
}
|
||||
}
|
||||
PageData statistics = customStatisticsService.findByCondition(pd);
|
||||
if (statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
|
||||
if (statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) {
|
||||
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString()) - 1);
|
||||
customStatisticsService.edit(statistics);
|
||||
}
|
||||
|
@ -867,40 +897,18 @@ public class CustomController extends BaseController {
|
|||
if (null != file && !file.isEmpty()) {
|
||||
File tempFile = new File(file.getOriginalFilename()); //新建file
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); //将MultipartFile复制到File
|
||||
List<PageData> listPd = (List) ObjectExcelRead.readExcel(tempFile, 2, 0, 0); //执行读EXCEL操作,读出的数据导入List 2:从第3行开始;0:从第A列开始;0:第0个sheet
|
||||
List<PageData> listPd = (List) ObjectExcelRead.readExcel(tempFile, 1, 0, 0); //执行读EXCEL操作,读出的数据导入List 2:从第3行开始;0:从第A列开始;0:第0个sheet
|
||||
/**
|
||||
* var0 :序号
|
||||
* var1 :清单名称
|
||||
* var2 :是否包保责任人任务
|
||||
* var3 :任务类型
|
||||
* var4 :部门
|
||||
* var5 :岗位
|
||||
* var6 :负责人
|
||||
* var7 :排查类型
|
||||
* var8 :排查周期
|
||||
* var9 :清单类型
|
||||
* var10 :排查日期
|
||||
* var11 :检查类别
|
||||
* var12 :检查项目
|
||||
* var13 :检查内容
|
||||
* var14 :检查标准
|
||||
* var15 :参考依据
|
||||
* var16 :检查合格项
|
||||
* var17 :检查不合格项
|
||||
* var18 :操作类型
|
||||
* var0 :检查类别
|
||||
* var1 :检查项目
|
||||
* var2 :检查内容
|
||||
* var3 :检查标准
|
||||
* var4 :参考依据
|
||||
* var5 :检查合格项
|
||||
* var6 :检查不合格项
|
||||
* var7 :操作类型
|
||||
*/
|
||||
List<String> header = new ArrayList<>();
|
||||
header.add("序号");
|
||||
header.add("清单名称");
|
||||
header.add("是否包保责任人任务");
|
||||
header.add("任务类型");
|
||||
header.add("部门");
|
||||
header.add("岗位");
|
||||
header.add("负责人");
|
||||
header.add("排查类型");
|
||||
header.add("排查周期");
|
||||
header.add("清单类型");
|
||||
header.add("排查日期");
|
||||
header.add("检查类别");
|
||||
header.add("检查项目");
|
||||
header.add("检查内容");
|
||||
|
@ -916,40 +924,19 @@ public class CustomController extends BaseController {
|
|||
* 判断excel是有有重复数据
|
||||
* 判断数据库是否有重复数据
|
||||
* 导入
|
||||
* 判断题的CD 为空 ( 多选题 单选题 判断题 )
|
||||
* 答案是否正确
|
||||
* 长度
|
||||
*/
|
||||
// 查询任务类型
|
||||
List<Dictionaries> taskTypeList = dictionaryService.listSubDictByParentId("7a1afe8a5e594b6a9e0cef42bd00f352");
|
||||
Map<String, String> taskTypeDegreeMap = taskTypeList.stream().collect(Collectors.toMap(Dictionaries::getNAME, Dictionaries::getDICTIONARIES_ID));
|
||||
// 排查类型
|
||||
List<Dictionaries> troubleshootingTypeList = dictionaryService.listSubDictByParentId("dc92de8a375c4b638b1b9f8d374e6426");
|
||||
Map<String, String> troubleshootingTypeDegreeMap = troubleshootingTypeList.stream().collect(Collectors.toMap(Dictionaries::getNAME, Dictionaries::getBIANMA));
|
||||
// 排查周期
|
||||
List<Dictionaries> troubleshootingCycleList = dictionaryService.listSubDictByParentId("f60cf0e8315b4993b6d6049dd29f2ba5");
|
||||
Map<String, String> troubleshootingCycleDegreeMap = troubleshootingCycleList.stream().collect(Collectors.toMap(Dictionaries::getNAME, Dictionaries::getBIANMA));
|
||||
// 清单类型
|
||||
List<Dictionaries> inventoryTypeList = dictionaryService.listSubDictByParentId("4a3d0d99b0ea4e268c11dd0b18866917");
|
||||
Map<String, String> inventoryTypeDegreeMap = inventoryTypeList.stream().collect(Collectors.toMap(Dictionaries::getNAME, Dictionaries::getBIANMA));
|
||||
// List<Dictionaries> departmentList = dictionaryService.listSubDictByParentId("4a3d0d99b0ea4e268c11dd0b18866917");
|
||||
List<PageData> listAll = new ArrayList<>();
|
||||
|
||||
Integer number = 1;//行数,用于提示用户
|
||||
Boolean firstFlag = true;
|
||||
String CUSTOM_ID = "";
|
||||
for (PageData lpd : listPd) {
|
||||
try {
|
||||
number++;
|
||||
for (int i = 0; i < 19; i++) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (i == 0) { // var0 :序号 非必填
|
||||
continue;
|
||||
}
|
||||
if (!lpd.containsKey("var" + i) || Tools.isEmpty(lpd.get("var" + i))) {
|
||||
if ("任务类型".equals(header.get(i))) {
|
||||
continue;
|
||||
}
|
||||
if ("排查日期".equals(header.get(i))) {
|
||||
continue;
|
||||
}
|
||||
if ("参考依据".equals(header.get(i))) {
|
||||
continue;
|
||||
}
|
||||
|
@ -961,63 +948,21 @@ public class CustomController extends BaseController {
|
|||
}
|
||||
|
||||
}
|
||||
String NAME = Tools.excelHandle(lpd.get("var1"));
|
||||
String BAO_BAO_TYPE = lpd.get("var2") == "是" ? "1" : "0";
|
||||
String TASK_TYPE = taskTypeDegreeMap.get(Tools.excelHandle(lpd.get("var3")));
|
||||
String DEPARTMENT_NAME = Tools.excelHandle(lpd.get("var4"));
|
||||
PageData depPd = new PageData();
|
||||
depPd.put("NAME", DEPARTMENT_NAME);
|
||||
depPd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
PageData depInfo = departmentService.findByName(depPd);
|
||||
String DEPARTMENT_ID = "";
|
||||
if (depInfo != null && Tools.notEmpty(depInfo.getString("DEPARTMENT_ID"))) {
|
||||
DEPARTMENT_ID = depInfo.get("DEPARTMENT_ID").toString();
|
||||
}else {
|
||||
errorStr.append("第" + number + "行的部门不存在;\n");
|
||||
continue;
|
||||
}
|
||||
PageData postPd = new PageData();
|
||||
postPd.put("DEPARTMENT_ID", DEPARTMENT_ID);
|
||||
postPd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
postPd.put("NAME", Tools.excelHandle(lpd.get("var5")));
|
||||
List<PageData> postList = postService.listAll(postPd);
|
||||
String POST_ID = "";
|
||||
if (postList.size() != 0 && Tools.notEmpty(postList.get(0).getString("POST_ID"))) {
|
||||
POST_ID = postList.get(0).getString("POST_ID");
|
||||
} else {
|
||||
errorStr.append("第" + number + "行的岗位不存在;\n");
|
||||
continue;
|
||||
}
|
||||
PageData userPd = new PageData();
|
||||
userPd.put("DEPARTMENT_ID", DEPARTMENT_ID);
|
||||
userPd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
userPd.put("POST_ID", POST_ID);
|
||||
userPd.put("NAME", Tools.excelHandle(lpd.get("var6")));
|
||||
List<PageData> userList = usersService.listAllUser(userPd);
|
||||
String USER_ID = "";
|
||||
if (userList.size() != 0 && Tools.notEmpty(userList.get(0).getString("USER_ID"))) {
|
||||
USER_ID = userList.get(0).getString("USER_ID");
|
||||
} else {
|
||||
errorStr.append("第" + number + "行的负责人不存在;\n");
|
||||
continue;
|
||||
}
|
||||
String SCREENTYPE = troubleshootingTypeDegreeMap.get(Tools.excelHandle(lpd.get("var7")));
|
||||
String PERIOD = troubleshootingCycleDegreeMap.get(Tools.excelHandle(lpd.get("var8")));
|
||||
String TYPE = inventoryTypeDegreeMap.get(Tools.excelHandle(lpd.get("var9")));
|
||||
String CHECK_CATEGORY = Tools.excelHandle(lpd.get("var11"));
|
||||
String CHECK_ITEM = Tools.excelHandle(lpd.get("var12"));
|
||||
String CHECK_CONTENT = Tools.excelHandle(lpd.get("var13"));
|
||||
String CHECK_STANDARD = Tools.excelHandle(lpd.get("var14"));
|
||||
String REFERENCE_BASIS = Tools.excelHandle(lpd.get("var15"));
|
||||
String CHECK_QUALIFIED = Tools.excelHandle(lpd.get("var16"));
|
||||
String CHECK_UNQUALIFIED = Tools.excelHandle(lpd.get("var17"));
|
||||
String OPERATION_TYPE = Tools.excelHandle(lpd.get("var18"));
|
||||
String CHECK_CATEGORY = Tools.excelHandle(lpd.get("var0"));
|
||||
String CHECK_ITEM = Tools.excelHandle(lpd.get("var1"));
|
||||
String CHECK_CONTENT = Tools.excelHandle(lpd.get("var2"));
|
||||
String CHECK_STANDARD = Tools.excelHandle(lpd.get("var3"));
|
||||
String REFERENCE_BASIS = Tools.excelHandle(lpd.get("var4"));
|
||||
String CHECK_QUALIFIED = Tools.excelHandle(lpd.get("var5"));
|
||||
String CHECK_UNQUALIFIED = Tools.excelHandle(lpd.get("var6"));
|
||||
String OPERATION_TYPE = "选择".equals(Tools.excelHandle(lpd.get("var7"))) ? "1" : "2";
|
||||
//检查类别和检查项目如果字典里存在,则不存字典,如果不存在,则存一下
|
||||
PageData dict = new PageData();
|
||||
dict.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
List<PageData> dictList = standardDictionaryService.list(dict);
|
||||
int maxsortNum = 0;
|
||||
Boolean exist = false;
|
||||
Boolean existCategory = false;
|
||||
String CHECK_CATEGORY_TEMP = "";
|
||||
for (int j = 0; j < dictList.size(); j++) {
|
||||
if ("1".equals(dictList.get(j).get("DICTIONARY_LEVEL").toString())) {
|
||||
if (!dictList.get(j).get("DICTIONARY_NAME").equals(CHECK_CATEGORY)) { //如果不存在该字典,获取最大排序号
|
||||
|
@ -1025,14 +970,16 @@ public class CustomController extends BaseController {
|
|||
maxsortNum = Integer.parseInt(dictList.get(j).getString("DICTIONARY_SORT"));
|
||||
}
|
||||
} else {
|
||||
exist = true;
|
||||
CHECK_CATEGORY_TEMP = dictList.get(j).get("DICTIONARY_ID").toString();
|
||||
existCategory = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!exist) {
|
||||
maxsortNum = maxsortNum == 0 ? 1 : maxsortNum + 1;
|
||||
if (!existCategory) {
|
||||
dict.put("DICTIONARY_ID", this.get32UUID());
|
||||
dict.put("DICTIONARY_LEVEL", "1");
|
||||
dict.put("DICTIONARY_SORT", maxsortNum + 1);
|
||||
dict.put("DICTIONARY_SORT", maxsortNum);
|
||||
dict.put("DICTIONARY_NAME", CHECK_CATEGORY);
|
||||
dict.put("PARENT_ID", "0");
|
||||
dict.put("PARENT_IDS", dict.get("DICTIONARY_ID"));
|
||||
|
@ -1049,11 +996,13 @@ public class CustomController extends BaseController {
|
|||
dict.put("DELETEOR_NAME", Jurisdiction.getUsername());
|
||||
dict.put("DELETE_TIME", DateUtil.date2Str(new Date()));
|
||||
standardDictionaryService.save(dict);
|
||||
CHECK_CATEGORY_TEMP = dict.get("DICTIONARY_ID").toString();
|
||||
}
|
||||
PageData dictItem = new PageData();
|
||||
dictItem.putAll(dict);
|
||||
maxsortNum = 0;
|
||||
exist = false;
|
||||
Boolean existItem = false;
|
||||
String CHECK_ITEM_TEMP = "";
|
||||
for (int j = 0; j < dictList.size(); j++) {
|
||||
if ("2".equals(dictList.get(j).get("DICTIONARY_LEVEL").toString())) {
|
||||
if (!dictList.get(j).get("DICTIONARY_NAME").equals(CHECK_ITEM)) { //如果不存在该字典,获取最大排序号
|
||||
|
@ -1061,33 +1010,36 @@ public class CustomController extends BaseController {
|
|||
maxsortNum = Integer.parseInt(dictList.get(j).getString("DICTIONARY_SORT"));
|
||||
}
|
||||
} else {
|
||||
exist = true;
|
||||
CHECK_ITEM_TEMP = dictList.get(j).get("DICTIONARY_ID").toString();
|
||||
existItem = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
maxsortNum = maxsortNum == 0 ? 1 : maxsortNum;
|
||||
if (!exist) {
|
||||
maxsortNum = maxsortNum == 0 ? 1 : maxsortNum + 1;
|
||||
if (!existItem) {
|
||||
dictItem.put("DICTIONARY_ID", this.get32UUID());
|
||||
dictItem.put("DICTIONARY_LEVEL", "2");
|
||||
dictItem.put("DICTIONARY_SORT", maxsortNum + 1);
|
||||
dictItem.put("DICTIONARY_SORT", maxsortNum);
|
||||
dictItem.put("DICTIONARY_NAME", CHECK_ITEM);
|
||||
dictItem.put("PARENT_ID", dict.get("DICTIONARY_ID"));
|
||||
dictItem.put("PARENT_IDS", dictItem.getString("DICTIONARY_ID") + ',' + dict.getString("DICTIONARY_ID"));
|
||||
dictItem.put("DICTIONARY_NAMES", dictItem.getString("DICTIONARY_NAME") + ',' + dict.getString("DICTIONARY_NAME"));
|
||||
standardDictionaryService.save(dictItem);
|
||||
CHECK_ITEM_TEMP = dictItem.get("DICTIONARY_ID").toString();
|
||||
}
|
||||
if (firstFlag) {
|
||||
// 隐患排查清单保存
|
||||
PageData customData = new PageData();
|
||||
customData.put("CUSTOM_ID", this.get32UUID());
|
||||
customData.put("NAME", NAME);
|
||||
customData.put("BAO_BAO_TYPE", BAO_BAO_TYPE);
|
||||
customData.put("TASK_TYPE", TASK_TYPE);
|
||||
customData.put("DEPARTMENT_ID", DEPARTMENT_ID);
|
||||
customData.put("POST_ID", POST_ID);
|
||||
customData.put("USER_ID", USER_ID);
|
||||
customData.put("SCREENTYPE", SCREENTYPE);
|
||||
customData.put("PERIOD", PERIOD);
|
||||
customData.put("TYPE", TYPE);
|
||||
customData.put("NAME", pd.getString("NAME"));
|
||||
customData.put("BAO_BAO_TYPE", pd.getString("BAO_BAO_TYPE"));
|
||||
customData.put("TASK_TYPE", pd.getString("TASK_TYPE"));
|
||||
customData.put("DEPARTMENT_ID", pd.getString("DEPARTMENT_ID"));
|
||||
customData.put("POST_ID", pd.getString("POST_ID"));
|
||||
customData.put("USER_ID", pd.getString("USER_ID"));
|
||||
customData.put("SCREENTYPE", pd.getString("SCREENTYPE"));
|
||||
customData.put("PERIOD", pd.getString("PERIOD"));
|
||||
customData.put("TYPE", pd.getString("TYPE"));
|
||||
customData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
customData.put("ISDELETE", "0"); //是否删除
|
||||
customData.put("CREATOR", Jurisdiction.getUsername()); //添加人
|
||||
|
@ -1095,20 +1047,22 @@ public class CustomController extends BaseController {
|
|||
customData.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
customData.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
customService.save(customData);
|
||||
|
||||
firstFlag = false;
|
||||
CUSTOM_ID = customData.getString("CUSTOM_ID");
|
||||
}
|
||||
// 隐患排查清单检查项保存
|
||||
PageData customItemData = new PageData();
|
||||
customItemData.putAll(customData);
|
||||
customItemData.put("CUSTOM_ITEM_ID", this.get32UUID()); //主键
|
||||
customItemData.put("CHECK_CATEGORY", CHECK_CATEGORY);
|
||||
customItemData.put("CHECK_ITEM", CHECK_ITEM);
|
||||
customItemData.put("CUSTOM_ID", CUSTOM_ID);
|
||||
customItemData.put("CHECK_CATEGORY", CHECK_CATEGORY_TEMP);
|
||||
customItemData.put("CHECK_ITEM", CHECK_ITEM_TEMP);
|
||||
customItemData.put("CHECK_CONTENT", CHECK_CONTENT);
|
||||
customItemData.put("CHECK_STANDARD", CHECK_STANDARD);
|
||||
customItemData.put("REFERENCE_BASIS", REFERENCE_BASIS);
|
||||
customItemData.put("CHECK_QUALIFIED", CHECK_QUALIFIED);
|
||||
customItemData.put("CHECK_UNQUALIFIED", CHECK_UNQUALIFIED);
|
||||
customItemData.put("OPERATION_TYPE", OPERATION_TYPE == "选择" ? "1" : "2");
|
||||
customItemData.put("COMMON_ITEM_SORT", dictItem.get("DICTIONARY_SORT"));
|
||||
customItemData.put("OPERATION_TYPE", OPERATION_TYPE);
|
||||
customItemData.put("COMMON_ITEM_SORT", maxsortNum);
|
||||
customItemData.put("CREATOR_ID", Jurisdiction.getUSER_ID());
|
||||
customItemData.put("CREATOR_NAME", Jurisdiction.getUsername());
|
||||
customItemData.put("CREATE_TIME", DateUtil.date2Str(new Date()));
|
||||
|
@ -1117,20 +1071,20 @@ public class CustomController extends BaseController {
|
|||
customItemData.put("OPERATE_TIME", DateUtil.date2Str(new Date()));
|
||||
customItemData.put("DELETEOR_ID", Jurisdiction.getUSER_ID());
|
||||
customItemData.put("DELETEOR_NAME", Jurisdiction.getUsername());
|
||||
customItemData.put("DELETE_TIME", DateUtil.date2Str(new Date()));
|
||||
customItemData.put("ISDELETE", "0"); //是否删除
|
||||
customItemService.save(customItemData);
|
||||
listAll.add(customData);
|
||||
// listAll.add(customData);
|
||||
// 修改清单统计
|
||||
PageData newpd = new PageData();
|
||||
newpd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
|
||||
newpd.put("CUSTOM_ID", customData.get("CUSTOM_ID"));
|
||||
if ("listType0005".equals(TYPE)) {
|
||||
newpd.put("CUSTOM_ID", CUSTOM_ID);
|
||||
if ("listType0005".equals(pd.getString("TYPE"))) {
|
||||
newpd.put("CUSTOMSTATISTICS_ID", this.get32UUID()); //主键
|
||||
newpd.put("STARTTIME", newpd.get("START_DATE").toString() + " 00:00:00");
|
||||
newpd.put("ENDTIME", newpd.get("END_DATE").toString() + " 23:59:59");
|
||||
newpd.put("PERIOD", null);
|
||||
PageData statistics = customStatisticsService.findByCondition(newpd);
|
||||
if (statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
|
||||
if (statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) {
|
||||
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString()) - 2);
|
||||
customStatisticsService.edit(statistics);
|
||||
}
|
||||
|
@ -1138,7 +1092,7 @@ public class CustomController extends BaseController {
|
|||
// 本期已检查的不计入统计
|
||||
customCheckRecordService.editStatistics(newpd);
|
||||
} else {
|
||||
switch (PERIOD) {
|
||||
switch (pd.getString("PERIOD")) {
|
||||
case "checkPeriod0001"://每日
|
||||
newpd.put("STARTTIME", DateUtil.getDay() + " 00:00:00");
|
||||
newpd.put("ENDTIME", DateUtil.getDay() + " 23:59:59");
|
||||
|
@ -1199,7 +1153,7 @@ public class CustomController extends BaseController {
|
|||
break;
|
||||
}
|
||||
PageData statistics = customStatisticsService.findByCondition(newpd);
|
||||
if (statistics != null && statistics.get("LISTSTATISTICS_ID") != null) {
|
||||
if (statistics != null && statistics.get("CUSTOMSTATISTICS_ID") != null) {
|
||||
statistics.put("NOTEXAMINEDNUM", Integer.parseInt(statistics.get("NOTEXAMINEDNUM").toString()) - 1);
|
||||
customStatisticsService.edit(statistics);
|
||||
}
|
||||
|
@ -1215,7 +1169,7 @@ public class CustomController extends BaseController {
|
|||
}
|
||||
|
||||
if (Tools.isEmpty(errorStr.toString())) {
|
||||
errorStr.append("成功导入" + listAll.size() + "条数据!");
|
||||
errorStr.append("成功导入" + (number - 1) + "条数据!");
|
||||
} else {
|
||||
errInfo = "error";
|
||||
}
|
||||
|
@ -1232,7 +1186,10 @@ public class CustomController extends BaseController {
|
|||
map.put("resultStr", errorStr.toString());
|
||||
return map;
|
||||
}
|
||||
/**修改
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
|
@ -1554,6 +1511,7 @@ public class CustomController extends BaseController {
|
|||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
//
|
||||
// /**导出到excel
|
||||
// * @param
|
||||
|
@ -1969,17 +1927,17 @@ public class CustomController extends BaseController {
|
|||
// return map;
|
||||
// }
|
||||
//
|
||||
// @RequestMapping(value = "/saveBaoBaoType")
|
||||
// @ResponseBody
|
||||
// public Object saveBaoBaoType() throws Exception {
|
||||
// Map<String, Object> map = new HashMap<String, Object>();
|
||||
// String errInfo = "success";
|
||||
// PageData pd = new PageData();
|
||||
// pd = this.getPageData();
|
||||
// listmanagerService.saveBaoBaoType(pd);
|
||||
// map.put("result", errInfo);
|
||||
// return map;
|
||||
// }
|
||||
@RequestMapping(value = "/saveBaoBaoType")
|
||||
@ResponseBody
|
||||
public Object saveBaoBaoType() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
customService.saveBaoBaoType(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
//
|
||||
// /**清单检查记录(日检)统计
|
||||
// * @param
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.controller.hiddenDangerCheckStandard;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.hiddenDangerCheckStandard.CustomTermLibraryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/customLabelFactory")
|
||||
public class CustomTermLibraryController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private CustomTermLibraryService customTermLibraryService;
|
||||
|
||||
@RequestMapping(value = "/termList")
|
||||
@ResponseBody
|
||||
public Object list() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
List<PageData> varList = customTermLibraryService.listAll(pd); //列出LabelFacory列表
|
||||
map.put("varList", varList);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.zcloud.mapper.datasource.hiddenDangerCheckStandard;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:标签库
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface CustomLabelFactoryMapper {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
List<PageData> findByAncestors(PageData condition);
|
||||
|
||||
void deleteByAncestors(PageData leafInfo);
|
||||
|
||||
List<PageData> findAllAncestors(PageData condition);
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.mapper.datasource.hiddenDangerCheckStandard;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:包保责任人明细项
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-10-13
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface CustomTermLibraryMapper {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.zcloud.service.hiddenDangerCheckStandard;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:标签库
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface CustomLabelFactoryService {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
|
||||
List<PageData> getTree(PageData condition) throws Exception;
|
||||
|
||||
List<PageData> saveTree(PageData pd) throws Exception;
|
||||
|
||||
List<PageData> findAllAncestors(PageData condition) throws Exception;
|
||||
}
|
||||
|
|
@ -106,7 +106,7 @@ public interface CustomService {
|
|||
*/
|
||||
List<PageData> getListByCorplistPage(Page page)throws Exception;
|
||||
|
||||
|
||||
void saveBaoBaoType(PageData pd) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.service.hiddenDangerCheckStandard;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:包保责任人明细项
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-10-13
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface CustomTermLibraryService {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
package com.zcloud.service.hiddenDangerCheckStandard.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomLabelFactoryMapper;
|
||||
import com.zcloud.service.hiddenDangerCheckStandard.CustomLabelFactoryService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.util.Warden;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:标签库
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class CustomLabelFacoryServiceImpl implements CustomLabelFactoryService {
|
||||
|
||||
@Resource
|
||||
private CustomLabelFactoryMapper customLabelFactoryMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd) throws Exception {
|
||||
customLabelFactoryMapper.save(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception {
|
||||
customLabelFactoryMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd) throws Exception {
|
||||
customLabelFactoryMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page) throws Exception {
|
||||
return customLabelFactoryMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表(全部)
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd) throws Exception {
|
||||
return customLabelFactoryMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd) throws Exception {
|
||||
return customLabelFactoryMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS) throws Exception {
|
||||
customLabelFactoryMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> getTree(PageData request) throws Exception {
|
||||
List<PageData> result = new ArrayList<>();
|
||||
PageData condition = new PageData();
|
||||
List<PageData> labels = customLabelFactoryMapper.findByAncestors(condition);
|
||||
for (PageData label : labels) {
|
||||
if ("1".equals(label.getString("IS_ANCESTORS_FLAG"))){
|
||||
condition.clear();
|
||||
condition.put("BUS_LABEL_FACTORY_ID",label.getString("BUS_LABEL_FACTORY_ID"));
|
||||
PageData ancestors = customLabelFactoryMapper.findById(condition);
|
||||
analysis(labels, ancestors);
|
||||
if (ancestors != null) {
|
||||
result.add(ancestors);
|
||||
}
|
||||
}
|
||||
}
|
||||
result = result.stream().sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT").toString())))).collect(Collectors.toList());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<PageData> saveTree(PageData pd) throws Exception {
|
||||
// 组织
|
||||
List<PageData> _tree = Warden.getList(pd.getString("tree"));
|
||||
PageData condition = new PageData();
|
||||
// 删除所有标签
|
||||
condition.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
|
||||
condition.put("TYPE",pd.getString("TYPE"));
|
||||
customLabelFactoryMapper.deleteByAncestors(condition);
|
||||
List<PageData> result = new ArrayList<>();
|
||||
for (PageData leaf : _tree) {
|
||||
Warden.initDate(leaf);
|
||||
leaf.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
if (leaf.get("BUS_LABEL_FACTORY_ID").toString().length() > 30) {
|
||||
if ("1".equals(leaf.getString("IS_ANCESTORS_FLAG"))) {
|
||||
leaf.put("NAME", leaf.getString("NAME"));
|
||||
customLabelFactoryMapper.save(leaf);
|
||||
} else {
|
||||
leaf.put("ANCESTORS_ID", leaf.getString("BUS_LABEL_FACTORY_ID"));
|
||||
leaf.put("NAME", leaf.getString("NAME"));
|
||||
leaf.put("PARENT_ID", "0");
|
||||
leaf.put("IS_ANCESTORS_FLAG", "1");
|
||||
leaf.put("TYPE", pd.getString("TYPE"));
|
||||
customLabelFactoryMapper.save(leaf);
|
||||
}
|
||||
} else {
|
||||
leaf.put("BUS_LABEL_FACTORY_ID", Warden.get32UUID());
|
||||
leaf.put("ANCESTORS_ID", leaf.getString("BUS_LABEL_FACTORY_ID"));
|
||||
leaf.put("NAME", leaf.getString("NAME"));
|
||||
leaf.put("PARENT_ID", "0");
|
||||
leaf.put("IS_ANCESTORS_FLAG", "1");
|
||||
leaf.put("TYPE", pd.getString("TYPE"));
|
||||
customLabelFactoryMapper.save(leaf);
|
||||
}
|
||||
analysis(leaf, result, 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> findAllAncestors(PageData condition) throws Exception {
|
||||
return customLabelFactoryMapper.findAllAncestors(condition);
|
||||
}
|
||||
|
||||
private void analysis(PageData pd, List<PageData> result, Integer level) {
|
||||
JSONArray children = (JSONArray) pd.get("children");
|
||||
if (children == null || children.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
List<PageData> tree = Warden.getList(children);
|
||||
result.addAll(tree);
|
||||
for (PageData leaf : tree) {
|
||||
leaf.put("BUS_LABEL_FACTORY_ID", leaf.get("BUS_LABEL_FACTORY_ID").toString().length() > 30 ? leaf.getString("BUS_LABEL_FACTORY_ID") : Warden.get32UUID());
|
||||
leaf.put("ANCESTORS_ID", pd.getString("ANCESTORS_ID"));
|
||||
leaf.put("PARENT_ID", pd.getString("BUS_LABEL_FACTORY_ID"));
|
||||
leaf.put("IS_ANCESTORS_FLAG", "0");
|
||||
leaf.put("LEVEL", level);
|
||||
leaf.put("CREATOR_ID", Jurisdiction.getUSER_ID());
|
||||
leaf.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
leaf.put("CREATED_TIME", DateUtil.date2Str(new Date()));
|
||||
leaf.put("ISDELETE", "0");
|
||||
leaf.put("TYPE", pd.getString("TYPE"));
|
||||
customLabelFactoryMapper.save(leaf);
|
||||
analysis(leaf, result, ++level);
|
||||
}
|
||||
}
|
||||
|
||||
private void analysis(List<PageData> labels, PageData parent) {
|
||||
List<PageData> sons = labels.stream()
|
||||
.filter(n -> n.getString("PARENT_ID").equals(parent.getString("BUS_LABEL_FACTORY_ID")))
|
||||
.sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT").toString()))))
|
||||
.collect(Collectors.toList());
|
||||
if (parent == null) {
|
||||
return;
|
||||
}
|
||||
parent.put("children", sons);
|
||||
if (sons.size() > 0) {
|
||||
for (PageData son : sons) {
|
||||
analysis(labels, son);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private PageData findParentNode(List<PageData> tree, PageData branch) throws Exception {
|
||||
for (PageData root : tree) {
|
||||
List<PageData> branches = (List<PageData>) root.get("children");
|
||||
if (branches.size() <= 0) {
|
||||
continue;
|
||||
}
|
||||
for (PageData _branch : branches) {
|
||||
if (branch.getString("BUS_LABEL_FACTORY_ID").equals(_branch.getString("BUS_LABEL_FACTORY_ID"))) {
|
||||
return root;
|
||||
}
|
||||
}
|
||||
PageData parentNode = findParentNode(branches, branch);
|
||||
if (parentNode != null && parentNode.size() > 0) {
|
||||
return parentNode;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void initNode(PageData info, PageData gene) {
|
||||
info.put("BUS_LABEL_FACTORY_ID", info.get("BUS_LABEL_FACTORY_ID").toString().length() > 30 ? info.getString("BUS_LABEL_FACTORY_ID") : Warden.get32UUID());
|
||||
info.put("PARENT_ID", gene.getString("BUS_LABEL_FACTORY_ID"));
|
||||
info.put("ANCESTORS_ID", gene.getString("ANCESTORS_ID"));
|
||||
info.put("IS_ANCESTORS_FLAG", "0");
|
||||
info.put("LEVEL", Integer.parseInt(gene.get("LEVEL").toString()) + 1);
|
||||
info.put("CREATOR_ID", Jurisdiction.getUSER_ID());
|
||||
info.put("CREATED_TIME", DateUtil.date2Str(new Date()));
|
||||
info.put("ISDELETE", "0");
|
||||
info.put("TYPE", gene.getString("TYPE"));
|
||||
JSONArray _children = (JSONArray) info.get("children");
|
||||
if (_children == null || _children.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
List<PageData> children = Warden.getList(_children);
|
||||
for (PageData child : children) {
|
||||
initNode(child, info);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,8 +2,11 @@ package com.zcloud.service.hiddenDangerCheckStandard.impl;
|
|||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.check.ListCheckItemMapper;
|
||||
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomMapper;
|
||||
import com.zcloud.service.hiddenDangerCheckStandard.CustomItemService;
|
||||
import com.zcloud.service.hiddenDangerCheckStandard.CustomService;
|
||||
import com.zcloud.util.Warden;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -22,6 +25,8 @@ public class CustomServiceImpl implements CustomService {
|
|||
|
||||
@Autowired
|
||||
private CustomMapper customMapper;
|
||||
@Autowired
|
||||
private CustomItemService customItemService;
|
||||
|
||||
|
||||
/**新增
|
||||
|
@ -147,6 +152,19 @@ public class CustomServiceImpl implements CustomService {
|
|||
public void edit(PageData pd)throws Exception{
|
||||
customMapper.edit(pd);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveBaoBaoType(PageData pd) throws Exception {
|
||||
List<PageData> itemList = Warden.getList(pd.getString("list"));
|
||||
for (PageData dto : itemList) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("CUSTOM_ITEM_ID",dto.get("CUSTOM_ITEM_ID"));
|
||||
PageData entity = customItemService.findById(condition);
|
||||
entity.put("BAO_BAO_NUM",dto.get("BAO_BAO_NUM"));
|
||||
customItemService.edit(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
package com.zcloud.service.hiddenDangerCheckStandard.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomTermLibraryMapper;
|
||||
import com.zcloud.service.hiddenDangerCheckStandard.CustomTermLibraryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:包保责任人明细项
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-10-13
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class CustomTermLibraryServiceImpl implements CustomTermLibraryService {
|
||||
|
||||
@Resource
|
||||
private CustomTermLibraryMapper customTermLibraryMapper;
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
customTermLibraryMapper.save(pd);
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
customTermLibraryMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
customTermLibraryMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
return customTermLibraryMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception{
|
||||
return customTermLibraryMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
return customTermLibraryMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||
customTermLibraryMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -98,10 +98,10 @@
|
|||
and f.COMMON_STATUS = 1
|
||||
and bhci.COMMON_ITEM_STATUS = 1
|
||||
<!-- and f.INDUSTRY_TYPE_NAMES = #{pd.CORP_TYPE_NAME} -->
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||
<if test="pd.OTHERKEYWORDS != null and pd.OTHERKEYWORDS != ''"><!-- 关键词检索 -->
|
||||
and
|
||||
(
|
||||
bhci.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
bhci.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{pd.OTHERKEYWORDS}),'%')
|
||||
)
|
||||
</if>
|
||||
<if test="pd.CHECK_CATEGORY != null and pd.CHECK_CATEGORY != ''"><!-- 检查类别 -->
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
CHECK_UNQUALIFIED = #{CHECK_UNQUALIFIED},
|
||||
OPERATION_TYPE = #{OPERATION_TYPE},
|
||||
BAO_BAO_NUM = #{BAO_BAO_NUM},
|
||||
LISTCHECKITEM_ID = LISTCHECKITEM_ID
|
||||
CUSTOM_ITEM_ID = CUSTOM_ITEM_ID
|
||||
where
|
||||
CUSTOM_ITEM_ID = #{CUSTOM_ITEM_ID}
|
||||
</update>
|
||||
|
@ -189,7 +189,8 @@
|
|||
blsd.NAME as TASK_TYPE_NAME,
|
||||
blsd.BZ as TASK_TYPE_NUM,
|
||||
bhd1.DICTIONARY_NAME as CHECK_CATEGORY_NAME,
|
||||
bhd2.DICTIONARY_NAME as CHECK_ITEM_NAME
|
||||
bhd2.DICTIONARY_NAME as CHECK_ITEM_NAME,
|
||||
btl.DESCRIBE as BAO_BAO_NUM_NAME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
left join bus_hiddendangercheckstandard_custom bl on bl.CUSTOM_ID = f.CUSTOM_ID
|
||||
|
@ -198,6 +199,7 @@
|
|||
left join sys_user u on u.USER_ID = bl.USER_ID
|
||||
left join bus_hiddendangercheckstandard_dictionary bhd1 on bhd1.DICTIONARY_ID = f.CHECK_CATEGORY and bhd1.ISDELETE = 0
|
||||
left join bus_hiddendangercheckstandard_dictionary bhd2 on bhd2.DICTIONARY_ID = f.CHECK_ITEM and bhd2.ISDELETE = 0
|
||||
left join bus_hiddendangercheckstandard_term_library btl on btl.TASK_NUM = f.BAO_BAO_NUM and btl.WORK_TYPE = blsd.BZ
|
||||
where f.ISDELETE = '0'
|
||||
<if test="CUSTOM_ID != null and CUSTOM_ID != ''"><!-- 检查表id -->
|
||||
and f.CUSTOM_ID = #{CUSTOM_ID}
|
||||
|
|
|
@ -0,0 +1,197 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomLabelFactoryMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
BUS_HIDDENDANGERCHECKSTANDARD_TERM_LIBRARY
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.PARENT_ID,
|
||||
f.ANCESTORS_ID,
|
||||
f.IS_ANCESTORS_FLAG,
|
||||
f.LEVEL,
|
||||
f.NAME,
|
||||
f.CREATOR_ID,
|
||||
f.CREATED_TIME,
|
||||
f.ISDELETE,
|
||||
f.SORT,
|
||||
f.TYPE,
|
||||
f.BUS_LABEL_FACTORY_ID,
|
||||
f.CORPINFO_ID
|
||||
</sql>
|
||||
|
||||
<!-- 字段用于新增 -->
|
||||
<sql id="Field2">
|
||||
PARENT_ID,
|
||||
ANCESTORS_ID,
|
||||
IS_ANCESTORS_FLAG,
|
||||
LEVEL,
|
||||
NAME,
|
||||
CREATOR_ID,
|
||||
CREATED_TIME,
|
||||
ISDELETE,
|
||||
SORT,
|
||||
TYPE,
|
||||
BUS_LABEL_FACTORY_ID,
|
||||
CORPINFO_ID
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{PARENT_ID},
|
||||
#{ANCESTORS_ID},
|
||||
#{IS_ANCESTORS_FLAG},
|
||||
#{LEVEL},
|
||||
#{NAME},
|
||||
#{CREATOR_ID},
|
||||
#{CREATED_TIME},
|
||||
#{ISDELETE},
|
||||
#{SORT},
|
||||
#{TYPE},
|
||||
#{BUS_LABEL_FACTORY_ID},
|
||||
#{CORPINFO_ID}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||
</delete>
|
||||
<delete id="deleteByAncestors" parameterType="pd">
|
||||
delete from
|
||||
<include refid="tableName"></include>
|
||||
where TYPE = #{TYPE}
|
||||
<if test="CORPINFO_ID != '' and CORPINFO_ID != null">
|
||||
and CORPINFO_ID = #{CORPINFO_ID}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
PARENT_ID = #{PARENT_ID},
|
||||
ANCESTORS_ID = #{ANCESTORS_ID},
|
||||
IS_ANCESTORS_FLAG = #{IS_ANCESTORS_FLAG},
|
||||
LEVEL = #{LEVEL},
|
||||
NAME = #{NAME},
|
||||
CREATOR_ID = #{CREATOR_ID},
|
||||
CREATED_TIME = #{CREATED_TIME},
|
||||
SORT = #{SORT},
|
||||
TYPE = #{TYPE},
|
||||
CORPINFO_ID = #{CORPINFO_ID},
|
||||
BUS_LABEL_FACTORY_ID = BUS_LABEL_FACTORY_ID
|
||||
where
|
||||
BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||
</select>
|
||||
|
||||
<select id="findByAncestors" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include>
|
||||
f
|
||||
where f.ISDELETE = '0'
|
||||
<if test="ANCESTORS_ID != null and ANCESTORS_ID != ''">
|
||||
and f.ANCESTORS_ID = #{ANCESTORS_ID}
|
||||
</if>
|
||||
<if test="TYPE != null and TYPE != ''">
|
||||
and f.TYPE = #{TYPE}
|
||||
</if>
|
||||
<if test="CORPINFO_ID != '' and CORPINFO_ID != null">
|
||||
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||
</if>
|
||||
<if test="IS_ANCESTORS_FLAG != null and IS_ANCESTORS_FLAG != ''">
|
||||
and f.IS_ANCESTORS_FLAG = #{IS_ANCESTORS_FLAG}
|
||||
</if>
|
||||
</select>
|
||||
<select id="findAllAncestors" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.IS_ANCESTORS_FLAG = '1' and f.ISDELETE = '0' and TYPE = #{TYPE}
|
||||
<if test="NAME != null and NAME != ''">
|
||||
and f.NAME LIKE CONCAT(CONCAT('%', #{NAME}),'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include>
|
||||
f
|
||||
where f.ISDELETE = '0'
|
||||
<if test="pd.NAME != null and pd.NAME != ''"><!-- 关键词检索 -->
|
||||
and f.NAME LIKE CONCAT(CONCAT('%', #{pd.NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.IS_ANCESTORS_FLAG != null and pd.IS_ANCESTORS_FLAG != ''"><!-- 关键词检索 -->
|
||||
and f.IS_ANCESTORS_FLAG = #{pd.IS_ANCESTORS_FLAG}
|
||||
</if>
|
||||
<if test="pd.TYPE != null and pd.TYPE != ''">
|
||||
and f.TYPE = #{pd.TYPE}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f where f.ISDELETE = '0'
|
||||
<if test="NAME != '' and NAME != null">
|
||||
and f.NAME = #{NAME}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="deleteAll" parameterType="String">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
BUS_LABEL_FACTORY_ID in
|
||||
<foreach item="item" index="index" collection="array" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -343,6 +343,72 @@
|
|||
<if test="pd.TYPE != null and pd.TYPE != ''"><!-- 关键词检索 -->
|
||||
and f.TYPE = #{pd.TYPE}
|
||||
</if>
|
||||
<choose>
|
||||
<when test='pd.ISMAIN != null and pd.ISMAIN != "" and pd.ISMAIN == "1"'>
|
||||
<if test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
|
||||
and
|
||||
f.DEPARTMENT_ID in
|
||||
<foreach item="item" index="index"
|
||||
collection="pd.DEPT_IDS" open="(" separator="," close=")">
|
||||
'${item}'
|
||||
</foreach>
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
<choose>
|
||||
<when test='pd.ISSUPERVISE != null and pd.ISSUPERVISE != "" and pd.ISSUPERVISE == "1"'>
|
||||
<choose>
|
||||
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
|
||||
and
|
||||
f.DEPARTMENT_ID in
|
||||
<foreach item="item" index="index"
|
||||
collection="pd.DEPT_IDS" open="(" separator="," close=")">
|
||||
'${item}'
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and
|
||||
(f.DEPARTMENT_ID in (
|
||||
select
|
||||
SUB_DEPARTMENT_ID
|
||||
from
|
||||
oa_supervision_department osd
|
||||
where
|
||||
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
|
||||
and osd.ISDELETE = '0'
|
||||
and osd.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
)or f.USER_ID = #{pd.USER_ID})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
<when test='pd.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
|
||||
<choose>
|
||||
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
|
||||
and
|
||||
f.DEPARTMENT_ID in
|
||||
<foreach item="item" index="index"
|
||||
collection="pd.DEPT_IDS" open="(" separator="," close=")">
|
||||
'${item}'
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
and
|
||||
f.DEPARTMENT_ID in
|
||||
<foreach item="item" index="index"
|
||||
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
|
||||
'${item}'
|
||||
</foreach>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
<when test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
|
||||
and f.DEPARTMENT_ID=#{pd.DEPARTMENT_ID}
|
||||
</when>
|
||||
<otherwise>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="pd.LISTINGLEVEL != null and pd.LISTINGLEVEL != ''"><!-- 关键词检索 -->
|
||||
<choose>
|
||||
<when test='pd.LISTINGLEVEL == "1"'>
|
||||
|
@ -353,8 +419,8 @@
|
|||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="pd.SCREENTYPE != null and pd.SCREENTYPE != ''"><!-- 关键词检索 -->
|
||||
and f.SCREENTYPE = #{pd.SCREENTYPE}
|
||||
<if test="pd.RISKCHECKLISTTYPE != null and pd.RISKCHECKLISTTYPE != ''"><!-- 关键词检索 -->
|
||||
and f.SCREENTYPE = #{pd.RISKCHECKLISTTYPE}
|
||||
</if>
|
||||
order by f.ISDELETE,f.OPERATTIME desc
|
||||
</select>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
bus_hiddendangercheckstandard_statistics
|
||||
BUS_HIDDENDANGERCHECKSTANDARD_STATISTICS
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
|
@ -79,7 +79,7 @@
|
|||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
LISTSTATISTICS_ID = #{LISTSTATISTICS_ID}
|
||||
CUSTOMSTATISTICS_ID = #{CUSTOMSTATISTICS_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 物理删除-->
|
||||
|
|
|
@ -0,0 +1,140 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomTermLibraryMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
BUS_HIDDENDANGERCHECKSTANDARD_TERM_LIBRARY
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.TASK_NUM,
|
||||
f.DESCRIBE,
|
||||
f.WORK_TYPE,
|
||||
f.IS_DELETE,
|
||||
f.CREATE_TIME,
|
||||
f.TERM_LIBRARY_ID,
|
||||
f.SORT
|
||||
</sql>
|
||||
|
||||
<!-- 字段用于新增 -->
|
||||
<sql id="Field2">
|
||||
TASK_NUM,
|
||||
DESCRIBE,
|
||||
WORK_TYPE,
|
||||
IS_DELETE,
|
||||
CREATE_TIME,
|
||||
TERM_LIBRARY_ID,
|
||||
SORT
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{TASK_NUM},
|
||||
#{DESCRIBE},
|
||||
#{WORK_TYPE},
|
||||
#{IS_DELETE},
|
||||
#{CREATE_TIME},
|
||||
#{TERM_LIBRARY_ID},
|
||||
#{SORT}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
IS_DELETE = '1'
|
||||
where
|
||||
TERM_LIBRARY_ID = #{TERM_LIBRARY_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
TASK_NUM = #{TASK_NUM},
|
||||
DESCRIBE = #{DESCRIBE},
|
||||
WORK_TYPE = #{WORK_TYPE},
|
||||
IS_DELETE = #{IS_DELETE},
|
||||
CREATE_TIME = #{CREATE_TIME},
|
||||
SORT = #{SORT},
|
||||
TERM_LIBRARY_ID = TERM_LIBRARY_ID
|
||||
where
|
||||
TERM_LIBRARY_ID = #{TERM_LIBRARY_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.TERM_LIBRARY_ID = #{TERM_LIBRARY_ID}
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.IS_DELETE = '0'
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||
and
|
||||
(
|
||||
<!-- 根据需求自己加检索条件
|
||||
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
or
|
||||
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
-->
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.IS_DELETE = '0'
|
||||
<if test="WORK_TYPE != null and WORK_TYPE != null">
|
||||
and f.WORK_TYPE = #{WORK_TYPE}
|
||||
</if>
|
||||
order by f.SORT asc
|
||||
</select>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="deleteAll" parameterType="String">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
IS_DELETE = '1'
|
||||
where
|
||||
TERM_LIBRARY_ID in
|
||||
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue