diff --git a/src/main/java/com/api/bokang/xiao/zscq/controller/ReserveSelectController.java b/src/main/java/com/api/bokang/xiao/zscq/controller/ReserveSelectController.java index 3be017f..ee75f63 100644 --- a/src/main/java/com/api/bokang/xiao/zscq/controller/ReserveSelectController.java +++ b/src/main/java/com/api/bokang/xiao/zscq/controller/ReserveSelectController.java @@ -6,6 +6,7 @@ import com.api.bokang.xiao.zscq.service.ReserveService; import com.api.bokang.xiao.zscq.service.impl.ReserveServiceImpl; import io.swagger.v3.oas.annotations.parameters.RequestBody; import org.apache.log4j.Logger; +import weaver.bokang.xiao.zscq.store.TableNameStore; import weaver.file.ImageFileManager; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; @@ -17,7 +18,9 @@ import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import javax.ws.rs.core.StreamingOutput; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -48,77 +51,68 @@ public class ReserveSelectController { @Produces(MediaType.APPLICATION_JSON) public String reserveSelect(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map param) { try{ - log.info("====== into getReportData success ======="); + log.info("====== into reserveSelect success ======="); log.info("param:"+param); User loginUser = HrmUserVarify.getUser(request, response); - List> result = reserveService.reserveSelect(param); + List> result = reserveService.reserveTrigger(param); return ApiResult.success(result); }catch (Exception e){ - log.error("获取搜索组件信息 ==> "+ Util.getErrString(e)); + log.error("反选执行出现异常 reserveSelect execute error ==> "+ Util.getErrString(e)); return ApiResult.error(e.getMessage()); } } - //@GET - //@Path("/batch") - //@Produces(MediaType.APPLICATION_OCTET_STREAM) - //public void downloadFiles(@QueryParam("ids") String ids, @Context HttpServletResponse response) { - // try { - // log.info("Start downloading files: {}"+ids); - // // 解析文件ID列表 - // List idList = Arrays.stream(ids.split(",")) - // .map(Long::parseLong) - // .collect(Collectors.toList()); - // - // // 生成压缩文件名 - // String zipFileName = "attachments.zip"; - // - // // 设置响应头,告诉浏览器该响应体是一个附件,浏览器会自动下载该响应体 - // response.setContentType(MediaType.APPLICATION_OCTET_STREAM); - // response.setHeader("Content-Disposition", "attachment; filename=\"" + zipFileName + "\""); - // - // // 创建压缩输出流 - // try (ZipOutputStream zipOutputStream = new ZipOutputStream(response.getOutputStream())) { - // - // // 遍历文件ID列表,将对应的文件加入到压缩文件中 - // for (Long id : idList) { - // // 通过ID获取文件信息 - // WeaverFile file = WeaverFileUtil.getFileMsgById(id); - // - // // 获取文件名和后缀名 - // String fileName = file.getName(); - // String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1); - // - // // 创建一个ZipEntry,表示压缩文件中的一个文件 - // ZipEntry zipEntry = new ZipEntry(fileName); - // zipEntry.setSize(file.getSize()); - // zipEntry.setTime(System.currentTimeMillis()); - // - // // 将ZipEntry添加到压缩输出流中 - // zipOutputStream.putNextEntry(zipEntry); - // - // // 将文件内容写入到压缩输出流中 - // byte[] buffer = new byte[BUFFER_SIZE]; - // int len; - // try (InputStream inputStream = file.getInputStream()) { - // while ((len = inputStream.read(buffer)) > 0) { - // zipOutputStream.write(buffer, 0, len); - // } - // } - // zipOutputStream.closeEntry(); - // } - // - // // 刷新压缩输出流 - // zipOutputStream.flush(); - // } - // log.info("Finish downloading files: {}"+ids); - // } catch (Exception e) { - // log.error("下载附件异常: {}"+Util.getErrString(e)); - // // 如果出现异常,返回一个空的响应体 - // response.reset(); - // response.setContentType(MediaType.APPLICATION_OCTET_STREAM); - // response.setContentLength(0); - // } - //} + @GET + @Path("/batchDownload") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public Response downloadBatchFiles(@QueryParam("datePicker") String datePicker, + @QueryParam("checkResult") String checkResult, + @QueryParam("checkResultShow") String checkResultShow) { + log.info("====== into downloadBatchFiles success ======="); + log.info(String.format("====== datePicker:[%s] checkResult:[%s] checkResultShow:[%s] =======",datePicker,checkResult,checkResultShow)); + Map param = new HashMap<>(8); + param.put("datePicker",datePicker); + param.put("checkResult",checkResult); + param.put("checkResultShow",checkResultShow); + String zipFileName = reserveService.getFileName(param) + ".zip"; + StreamingOutput streamingOutput = outputStream -> { + try { + reserveService.batchDownload(param, outputStream); + } catch (Exception e) { + log.error("下载文件异常 download zip error ==>"+Util.getErrString(e)); + } + }; + log.info("zip file name ==>"+zipFileName); + return Response.ok(streamingOutput, MediaType.APPLICATION_OCTET_STREAM) + .header("Content-Disposition", "attachment; filename=\"" + zipFileName + "\"") + .build(); + } + + @GET + @Path("/refreshStore") + public String refreshStore(@Context HttpServletRequest request, @Context HttpServletResponse response){ + try{ + log.info("====== into refreshStore success ======="); + TableNameStore.getInstance().refresh(); + return ApiResult.successNoData(); + }catch (Exception e){ + log.error("refreshStore execute error ==> "+ Util.getErrString(e)); + return ApiResult.error(e.getMessage()); + } + } + + @GET + @Path("/doRepossessedSign") + public String doRepossessedSign(@QueryParam("requestId") String requestId){ + try{ + log.info("====== into doRepossessedSign success ======="); + log.info("requestId =>"+requestId); + new ReserveServiceImpl().doRepossessedSign(Util.getIntValue(requestId),new User(1)); + return ApiResult.successNoData(); + }catch (Exception e){ + log.error("refreshStore execute error ==> "+ Util.getErrString(e)); + return ApiResult.error(e.getMessage()); + } + } } diff --git a/src/main/java/com/api/bokang/xiao/zscq/entity/SendFileEntity.java b/src/main/java/com/api/bokang/xiao/zscq/entity/SendFileEntity.java index 5a61ceb..ac758fe 100644 --- a/src/main/java/com/api/bokang/xiao/zscq/entity/SendFileEntity.java +++ b/src/main/java/com/api/bokang/xiao/zscq/entity/SendFileEntity.java @@ -1,8 +1,28 @@ -package com.api.bokang.xiao.zscq.entity;/** - *@ClassName SendFileEntity - *@Author 肖博亢 - *@Date 2023/4/23 10:10 - *@Description

+package com.api.bokang.xiao.zscq.entity; + +import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn; +import lombok.Data; + +/** + * @ClassName SendFileEntity + * @Author 肖博亢 + * @Date 2023/4/23 10:10 + * @Description

**/ +@Data public class SendFileEntity { + + @SqlOracleDbFieldAnn(value = "ID") + private Integer id; + + @SqlOracleDbFieldAnn(value = "DEPART_ID") + private Integer departId; + + @SqlOracleDbFieldAnn(value = "DEPART_NAME") + private String departName; + + @SqlOracleDbFieldAnn(value = "SQH") + private String requestNumber; + + private WeaverFile weaverFile; } diff --git a/src/main/java/com/api/bokang/xiao/zscq/entity/WeaverFile.java b/src/main/java/com/api/bokang/xiao/zscq/entity/WeaverFile.java index 25efe04..80dcd6f 100644 --- a/src/main/java/com/api/bokang/xiao/zscq/entity/WeaverFile.java +++ b/src/main/java/com/api/bokang/xiao/zscq/entity/WeaverFile.java @@ -1,8 +1,26 @@ -package com.api.bokang.xiao.zscq.entity;/** - *@ClassName WeaverFile - *@Author 肖博亢 - *@Date 2023/4/23 10:09 - *@Description

+package com.api.bokang.xiao.zscq.entity; + +import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn; +import lombok.Data; + +/** + * @ClassName WeaverFile + * @Author 肖博亢 + * @Date 2023/4/23 10:09 + * @Description

**/ +@Data public class WeaverFile { + + @SqlOracleDbFieldAnn(value = "IMAGEFILEID") + private Integer imageFileId; + + @SqlOracleDbFieldAnn(value = "DOCID") + private Integer docId; + + @SqlOracleDbFieldAnn(value = "FILESIZE") + private Integer fileSize; + + @SqlOracleDbFieldAnn(value = "IMAGEFILENAME") + private String fileName; } diff --git a/src/main/java/com/api/bokang/xiao/zscq/mapper/QueryMapper.java b/src/main/java/com/api/bokang/xiao/zscq/mapper/QueryMapper.java index 4c2e603..ab2d464 100644 --- a/src/main/java/com/api/bokang/xiao/zscq/mapper/QueryMapper.java +++ b/src/main/java/com/api/bokang/xiao/zscq/mapper/QueryMapper.java @@ -1,8 +1,56 @@ -package com.api.bokang.xiao.zscq.mapper;/** - *@ClassName QueryMapper - *@Author 肖博亢 - *@Date 2023/4/23 10:14 - *@Description

+package com.api.bokang.xiao.zscq.mapper; + +import aiyh.utils.annotation.recordset.*; +import com.api.bokang.xiao.zscq.entity.SendFileEntity; +import com.api.bokang.xiao.zscq.entity.WeaverFile; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName QueryMapper + * @Author 肖博亢 + * @Date 2023/4/23 10:14 + * @Description

**/ +@SqlMapper public interface QueryMapper { + + /** + *

查询附件下载列表

+ * @param param 参数 + * @return 附件信息列表 + */ + @Select("select gjj.id as id,depart.id as depart_id,depart.DEPARTMENTNAME as depart_name,xgfj,sqh " + + " from uf_gjjtb gjj " + + " inner join hrmdepartment depart on gjj.xfqj = depart.id " + + " where concat(',',concat(sjpcdxk,',')) like concat('%,',concat(#{datePicker},',%')) " + + " and hcqkdx = #{checkResult} and gjj.xgfj is not null ") + @Associations( @Association(property = "weaverFile",column = "xgfj",id = @Id(value = Integer.class,methodId = 1))) + List queryDownloadList(Map param); + + /** + *

查询附件信息

+ * @param docId docId + * @return 附件信息 + */ + @AssociationMethod(value = 1) + @Select("select dm.docid,dm.imagefileid,dm.imagefilename,file.filesize " + + " from docimagefile dm inner join imagefile file on dm.imagefileid = file.imagefileid" + + " where docid = #{docId}") + WeaverFile queryFile(@ParamMapper("id")Integer docId); + + /** + *

获取下拉框信息

+ * @param tableName 表名 + * @param fieldName 字段名 + * @return 下拉框信息 + */ + @Select("select selectvalue,selectname " + + " from workflow_selectitem se " + + " inner join workflow_billfield bf on se.fieldid = bf.id " + + " inner join workflow_bill bi on bf.billid = bi.id " + + " where tablename = #{tableName} and bf.fieldname = #{fieldName} ") + List> querySelectItem(@ParamMapper("tableName") String tableName,@ParamMapper("fieldName") String fieldName); + } diff --git a/src/main/java/com/api/bokang/xiao/zscq/mapper/ReserveSelectMapper.java b/src/main/java/com/api/bokang/xiao/zscq/mapper/ReserveSelectMapper.java index 53d5086..d6619f8 100644 --- a/src/main/java/com/api/bokang/xiao/zscq/mapper/ReserveSelectMapper.java +++ b/src/main/java/com/api/bokang/xiao/zscq/mapper/ReserveSelectMapper.java @@ -19,7 +19,7 @@ public interface ReserveSelectMapper { * @param requestId 流程id * @return 操作人信息 */ - @Select("select operator userId,operatortype userType from workflow_requestlog where requestid=#{requestId}" + + @Select("select operator userid,operatortype usertype from workflow_requestlog where requestid=#{requestId}" + " and (logtype='2' or logtype='0' or logtype='3' or logtype='e') " + " and exists(select 1 from workflow_currentoperator where requestid=workflow_requestlog.requestid and userid=workflow_requestlog.operator and usertype=workflow_requestlog.operatortype and isremark='2' and preisremark='0' and operatedate is not null and operatedate>' ') " + " group by operator,operatortype order by max(logid) desc") @@ -30,7 +30,7 @@ public interface ReserveSelectMapper { * @param requestId 流程id * @return 操作人信息 */ - @Select("select userid userId,usertype userType from workflow_currentoperator where requestid = #{requestId} and isremark = '2' and preisremark='0' and operatedate is not null and operatedate>' ' order by operatedate desc ,operatetime desc") + @Select("select userid,usertype from workflow_currentoperator where requestid = #{requestId} and isremark = '2' and preisremark='0' and operatedate is not null and operatedate>' ' order by operatedate desc ,operatetime desc") Map queryOperator(@ParamMapper("requestId")String requestId); /** @@ -38,17 +38,26 @@ public interface ReserveSelectMapper { * @param param 参数信息 * @return 建模数据 */ - @Select("select id, $t{applicationNoField}, $t{workflowInfoField}, $t{checkResultField} from $t{modeTableName} where $t{dateField} = #{datePicker}") + @Select("select id, $t{applicationNoField}, $t{workflowInfoField}, $t{checkResultField} from $t{modeTableName} where concat(',',concat($t{dateField},',')) like #{datePicker} and ($t{markField} <> 0 or $t{markField} is not null)") @CaseConversion(value = false) List> queryModeList(Map param); + /** + *

更新检查结果

+ * @param param 参数信息 + * @return 更新结果 + */ + @Update("update $t{modeTableName} set $t{markField} = 1 " + + " where concat(',',concat($t{dateField},',')) like #{datePicker}") + boolean updateModeDataStatus(@ParamMapper("param") Map param); + /** *

更新检查结果

* @param forceOverList 强制归档流程id集合 * @param param 参数信息 * @return 更新结果 */ - @Update("update $t{param.modeTableName} set $t{param.checkResultField} = #{param.repossessedValue} " + + @Update("update $t{param.modeTableName} set $t{param.markField} = #{param.repossessedValue} " + " where $t{param.workflowInfoField} in (${doRepossessedList})") boolean updateRepossessed(@ParamMapper("doRepossessedList") List forceOverList, @ParamMapper("param") Map param); diff --git a/src/main/java/com/api/bokang/xiao/zscq/service/ReserveService.java b/src/main/java/com/api/bokang/xiao/zscq/service/ReserveService.java index 37f0d30..3006111 100644 --- a/src/main/java/com/api/bokang/xiao/zscq/service/ReserveService.java +++ b/src/main/java/com/api/bokang/xiao/zscq/service/ReserveService.java @@ -3,6 +3,7 @@ package com.api.bokang.xiao.zscq.service; import aiyh.utils.Util; import org.apache.log4j.Logger; +import java.io.OutputStream; import java.util.List; import java.util.Map; @@ -22,4 +23,26 @@ public interface ReserveService { * @return 操作结果 */ List> reserveSelect(Map param); + + /** + *

反选操作

+ * @param param 参数信息 + * @return 操作结果 + */ + List> reserveTrigger(Map param); + + /** + *

将附件信息合并

+ * @param param 查询参数 + * @param outputStream 输出流 + * @throws Exception 异常信息 + */ + void batchDownload(Map param, OutputStream outputStream) throws Exception; + + /** + *

获取文件名

+ * @param param 参数信息 + * @return 文件名 + */ + String getFileName(Map param); } diff --git a/src/main/java/com/api/bokang/xiao/zscq/service/impl/ReserveServiceImpl.java b/src/main/java/com/api/bokang/xiao/zscq/service/impl/ReserveServiceImpl.java index 96d6ef1..855b5b2 100644 --- a/src/main/java/com/api/bokang/xiao/zscq/service/impl/ReserveServiceImpl.java +++ b/src/main/java/com/api/bokang/xiao/zscq/service/impl/ReserveServiceImpl.java @@ -1,16 +1,27 @@ package com.api.bokang.xiao.zscq.service.impl; import aiyh.utils.Util; +import com.alibaba.fastjson.JSON; +import com.api.bokang.xiao.zscq.entity.SendFileEntity; +import com.api.bokang.xiao.zscq.entity.WeaverFile; +import com.api.bokang.xiao.zscq.mapper.QueryMapper; import com.api.bokang.xiao.zscq.mapper.ReserveSelectMapper; import com.api.bokang.xiao.zscq.service.ReserveService; +import weaver.bokang.xiao.zscq.config.service.ModeChangeService; +import weaver.conn.RecordSet; +import weaver.file.ImageFileManager; import weaver.hrm.User; import weaver.workflow.workflow.RequestForceDrawBack; import weaver.workflow.workflow.WfForceDrawBack; import weaver.workflow.workflow.WfForceOver; import weaver.workflow.workflow.WfFunctionManageUtil; +import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.*; import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; /** @@ -23,6 +34,8 @@ public class ReserveServiceImpl implements ReserveService { private final ReserveSelectMapper reserveSelectMapper = Util.getMapper(ReserveSelectMapper.class); + private final QueryMapper queryMapper = Util.getMapper(QueryMapper.class); + private final WfForceOver wfForceOver = new WfForceOver(); private final WfFunctionManageUtil wfFunctionManageUtil = new WfFunctionManageUtil(); @@ -30,6 +43,11 @@ public class ReserveServiceImpl implements ReserveService { private final WfForceDrawBack wfForceDrawBack = new WfForceDrawBack(); private final RequestForceDrawBack requestForceDrawBack = new RequestForceDrawBack(); + private final ModeChangeService modeChangeService = new ModeChangeService(); + + private static final int BUFFER_SIZE = 4096; + + /** *

流程强制收回 * @param requestIdList 流程id集合 @@ -51,15 +69,19 @@ public class ReserveServiceImpl implements ReserveService { * @param user 用户信息 * @return 操作结果 */ - private boolean doRepossessedSign(int requestId,User user){ + public boolean doRepossessedSign(int requestId,User user){ //查询最后一个操作者 Map operateInfo = reserveSelectMapper.queryRequestMsg(String.valueOf(requestId)); - log.info(" doRepossessedSign operateInfo ==>"+operateInfo); if(Objects.isNull(operateInfo)){ operateInfo = reserveSelectMapper.queryOperator(String.valueOf(requestId)); } - int tempUser = operateInfo.get("userId"); - int tempUserType = operateInfo.get("userType"); + log.info(" doRepossessedSign operateInfo ==>"+operateInfo); + if(Objects.isNull(operateInfo)){ + log.error(String.format("流程 requestId:[%s] 操作者 operateInfo no find 流程可能未归档 !!!",requestId)); + return false; + } + int tempUser = operateInfo.get("userid"); + int tempUserType = operateInfo.get("usertype"); boolean canForceDrawBack = false; if(RequestForceDrawBack.isOldRequest(requestId) == RequestForceDrawBack.OLDDATA){ canForceDrawBack = wfForceDrawBack.isHavePurview(requestId, user.getUID(), Integer.parseInt(user.getLogintype()), tempUser, tempUserType); @@ -68,6 +90,7 @@ public class ReserveServiceImpl implements ReserveService { } if (canForceDrawBack && wfFunctionManageUtil.haveOtherOperationRight(requestId)) { int result = requestForceDrawBack.foreceDrawBack(user, requestId, true, tempUser, tempUserType); + log.info(String.format("流程 requestId:[%s] 撤回结果 drawBack result:[%d] message:[%s]",requestId,result,requestForceDrawBack.getMessage())); return requestForceDrawBack.isAddInOperateSuccess(); }else{ return false; @@ -97,9 +120,9 @@ public class ReserveServiceImpl implements ReserveService { String checkResult = Util.null2String(modeInfo.get(checkResultField)); int requestId = Util.getIntValue(Util.null2String(modeInfo.get(workflowInfoField))); if(checkResult.equals(checkResultValue)){ - forceOverList.add(requestId+""); - }else { doRepossessedList.add(requestId); + }else { + forceOverList.add(requestId+""); } } log.info(String.format("doRepossessedList ==> %s forceOverList ==> %s",doRepossessedList,forceOverList)); @@ -111,4 +134,91 @@ public class ReserveServiceImpl implements ReserveService { } return result; } + + @Override + public List> reserveTrigger(Map param) { + List> result = new ArrayList<>(); + String applicationNoField = Util.null2String(param.get("applicationNoField")); + String workflowInfoField = Util.null2String(param.get("workflowInfoField")); + String formId = Util.null2String(param.get("formId")); + List> modeList = reserveSelectMapper.queryModeList(param); + if(Objects.nonNull(modeList) && !modeList.isEmpty()){ + for (Map modeMap : modeList) { + Map dealResult = new HashMap<>(); + try{ + modeChangeService.changeOtherMode(modeMap,formId,2); + dealResult.put(Util.null2String(modeMap.get(applicationNoField)),true); + }catch (Exception e){ + log.error("执行异常 reserveTrigger error ==>"+modeMap); + dealResult.put(Util.null2String(modeMap.get(applicationNoField)),false); + } + result.add(dealResult); + } + reserveSelectMapper.updateModeDataStatus(param); + } + return result; + } + + @Override + public void batchDownload(Map param, OutputStream outputStream) throws IOException { + List sendList = queryMapper.queryDownloadList(param); + if(Objects.isNull(sendList) || sendList.isEmpty()){ + log.info("附件列表为空 attachment empty !!!"); + //throw new CustomerException("附件列表查询为空"); + return; + } + log.info("查询到的附件信息 query fileList ==>"+ JSON.toJSONString(sendList)); + // 1. 将 SendFileEntity 按照 departName 分组 + Map> sendMap = sendList.stream().collect(Collectors.groupingBy(SendFileEntity::getDepartName)); + // 2. 创建 ZipOutputStream + ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(outputStream)); + // 3. 遍历 SendFileEntity + for (Map.Entry> entry : sendMap.entrySet()) { + String departName = entry.getKey(); + List fileList = entry.getValue(); + // 4. 创建目录 + ZipEntry dirEntry = new ZipEntry(departName + File.separator); + zipOutputStream.putNextEntry(dirEntry); + // 5. 将附件信息合并成一个压缩包 + for (SendFileEntity sendFileEntity : fileList) { + WeaverFile fileMsg = sendFileEntity.getWeaverFile(); + int imageFileId = fileMsg.getImageFileId(); + String fileName = fileMsg.getFileName(); + String fileType = fileName.substring(fileName.lastIndexOf(".")); + String tempFileName = sendFileEntity.getRequestNumber() + fileType; + InputStream inputStream = ImageFileManager.getInputStreamById(imageFileId); + // 6. 将单个附件写入 ZipOutputStream + ZipEntry fileEntry = new ZipEntry(departName + File.separator + tempFileName); + zipOutputStream.putNextEntry(fileEntry); + + byte[] buffer = new byte[BUFFER_SIZE]; + int bytesRead = -1; + while ((bytesRead = inputStream.read(buffer)) != -1) { + zipOutputStream.write(buffer, 0, bytesRead); + } + inputStream.close(); + } + } + // 7. 关闭 ZipOutputStream + zipOutputStream.close(); + } + + @Override + public String getFileName(Map param) { + String fileName = ""; + List> selectItems = queryMapper.querySelectItem("uf_gjjtb", "sjpcdxk"); + if(Objects.nonNull(selectItems) && !selectItems.isEmpty()){ + Map map = selectItems.stream().collect(Collectors + .toMap( + item -> Util.null2String(item.get("selectvalue")), + item -> Util.null2String(item.get("selectname")) + ) + ); + String datePicker = Util.null2String(param.get("datePicker")); + String checkResultShow = new String(Util.null2String(param.get("checkResultShow")).getBytes(), StandardCharsets.UTF_8); + String datePickerShow = Util.null2String(map.get(datePicker)); + fileName = datePickerShow + checkResultShow; + } + return fileName; + } } diff --git a/src/main/java/com/api/interfaces/liyi/DataCenterApi.java b/src/main/java/com/api/interfaces/liyi/DataCenterApi.java index 3e68f9e..2f5fab0 100644 --- a/src/main/java/com/api/interfaces/liyi/DataCenterApi.java +++ b/src/main/java/com/api/interfaces/liyi/DataCenterApi.java @@ -103,6 +103,40 @@ public class DataCenterApi extends BaseBean { String tbr = rs.getString("field048"); String sfty = rs.getString("field069"); + /* update by bokang.xiao */ + //现居住地址 + String residentialAddress = rs.getString("field045"); + //现居地址邮编 + String residentialPostcode = rs.getString("field104"); + //家庭住址 + String familyAddress = rs.getString("field105"); + //法定联系地址 + String contactAddress = rs.getString("field106"); + //法定联系地址邮编 + String contactPostcode = rs.getString("field107"); + //紧急联系人地址 + String emergencyContactAddress = rs.getString("field108"); + //一寸照片 + String headPicture = rs.getString("field109"); + //公积金账户及所在城市 + String providentFundAccount = rs.getString("field110"); + //开户行 + String openingBank = rs.getString("field111"); + //银行卡号 + String bankCardNo = rs.getString("field112"); + + comMap.put("residentialAddress",residentialAddress); + comMap.put("residentialPostcode",residentialPostcode); + comMap.put("familyAddress",familyAddress); + comMap.put("contactAddress",contactAddress); + comMap.put("contactPostcode",contactPostcode); + comMap.put("emergencyContactAddress",emergencyContactAddress); + comMap.put("providentFundAccount",providentFundAccount); + comMap.put("openingBank",openingBank); + comMap.put("bankCardNo",bankCardNo); + comMap.put("headPicture",headPicture); + /* update by bokang.xiao */ + comMap.put("ypgw",ypgw); comMap.put("ypgw_xz",ypgw_xz); comMap.put("djrq",djrq); diff --git a/src/main/java/com/api/nonstandardext/zenner/utils/ZennerUtil.java b/src/main/java/com/api/nonstandardext/zenner/utils/ZennerUtil.java index 9182431..1dfe37d 100644 --- a/src/main/java/com/api/nonstandardext/zenner/utils/ZennerUtil.java +++ b/src/main/java/com/api/nonstandardext/zenner/utils/ZennerUtil.java @@ -311,7 +311,7 @@ public class ZennerUtil { */ public static int getQuarter() { Calendar c = Calendar.getInstance(); - int month = c.get(c.MONTH) + 1; + int month = c.get(Calendar.MONTH) + 1; int quarter = 0; if (month >= 1 && month <= 3) { quarter = 1; diff --git a/src/main/java/com/engine/hrm/cmd/departmentfielddefined/GetFieldDefinedCmd.java b/src/main/java/com/engine/hrm/cmd/departmentfielddefined/GetFieldDefinedCmd.java index 0fc9e5b..6ac4a3a 100644 --- a/src/main/java/com/engine/hrm/cmd/departmentfielddefined/GetFieldDefinedCmd.java +++ b/src/main/java/com/engine/hrm/cmd/departmentfielddefined/GetFieldDefinedCmd.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.alibaba.fastjson.JSON; import com.cloudstore.dev.api.util.TextUtil; import com.engine.common.biz.AbstractCommonCommand; import com.engine.common.biz.EncryptConfigBiz; @@ -12,6 +13,8 @@ import com.engine.common.entity.BizLogContext; import com.engine.common.entity.EncryptFieldEntity; import com.engine.common.enums.EncryptMould; import com.engine.core.interceptor.CommandContext; +import org.apache.log4j.Logger; +import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper; import weaver.conn.RecordSet; import weaver.general.LabelUtil; import weaver.general.Util; @@ -31,6 +34,10 @@ import weaver.workflow.field.BrowserComInfo; public class GetFieldDefinedCmd extends AbstractCommonCommand> { + private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class); + + private final Logger log = aiyh.utils.Util.getLogger(); + public GetFieldDefinedCmd(Map params, User user) { this.user = user; this.params = params; @@ -190,6 +197,14 @@ public class GetFieldDefinedCmd extends AbstractCommonCommand groupId:%s fieldId:%s",groupId,fieldid)); + if(groupId == 6 || groupId == 7) { + recordInfo.put("isEdit", formFieldMapper.queryIsEdit(fieldid, groupId)); + } + log.info("recordInfo ==>"+ JSON.toJSONString(recordInfo)); + if (encryptEnable && ((fieldhtmltype.equals("1")||fieldhtmltype.equals("2")) && !issystem.equals("1")) ) { //只支持单行文本,多行文本 String tablename = "hrmdepartmentdefined"; diff --git a/src/main/java/com/engine/hrm/cmd/departmentfielddefined/SaveFieldDefinedCmd.java b/src/main/java/com/engine/hrm/cmd/departmentfielddefined/SaveFieldDefinedCmd.java index 6a55493..54d479e 100644 --- a/src/main/java/com/engine/hrm/cmd/departmentfielddefined/SaveFieldDefinedCmd.java +++ b/src/main/java/com/engine/hrm/cmd/departmentfielddefined/SaveFieldDefinedCmd.java @@ -17,6 +17,8 @@ import com.engine.core.interceptor.CommandContext; import com.engine.hrm.entity.FieldBean; import com.engine.hrm.entity.FieldSelectOptionBean; import com.engine.hrm.util.HrmUtil; +import org.apache.log4j.Logger; +import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper; import weaver.conn.RecordSet; import weaver.docs.docs.FieldParam; import weaver.general.LabelUtil; @@ -38,6 +40,10 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand params, User user) { this.user = user; this.params = params; @@ -121,7 +127,13 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand"+groupId); + if("6".equals(groupId) || "7".equals(groupId)){ + this.save(fieldBean,groupId,records.getJSONObject(i)); + }else { + this.save(fieldBean, groupId); + } } HrmFieldComInfo.removeFieldCache(); @@ -135,7 +147,84 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand保存更新方法

+ * @author bokang.xiao + * @param fieldBean 字段信息实体类 + * @param groupId 组id + * @param fieldJson 字段JSON信息 + */ + private void save(FieldBean fieldBean, String groupId,JSONObject fieldJson){ + try { + HrmUtil hrmUtil = new HrmUtil(); + HrmDeptFieldManagerE9 hfm = new HrmDeptFieldManagerE9(5); + + String fieldId = Util.null2String(fieldBean.getId()); + String fieldLabel = Util.null2String(fieldBean.getFieldlabel()); + String fieldName = Util.null2String(fieldBean.getFieldname()); + String fieldHtmlType = ""; + String type = ""; + String typeDetial = ""; + String dmlUrl = ""; + if(fieldBean.getFieldTypeBean()!=null){ + fieldHtmlType = Util.null2String(fieldBean.getFieldTypeBean().getFieldHtmlType()); + type = Util.null2String(fieldBean.getFieldTypeBean().getFieldType()); + if(fieldHtmlType.equals("1")||fieldHtmlType.equals("2")){ + typeDetial = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam()); + }else if(fieldHtmlType.equals("66") || fieldHtmlType.equals("67")){ + dmlUrl = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam()); + } else if (type.equals("161") || type.equals("162") || type.equals("256")|| type.equals("257")) { + dmlUrl = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam()); + } + } + + String isUse = Util.null2String(fieldBean.getEnable(),"0"); + String isMand = Util.null2String(fieldBean.getRequired(),"0"); + String fieldOrder = Util.null2String(fieldBean.getKey()); + + int temId = Util.getIntValue(fieldId,-1); + //int lableid = hrmUtil.getFieldLabelId(fieldLabel); + int lableid = new LabelUtil().getLabelId(fieldLabel); + + if(Util.null2String(fieldId).length()==0){ + FieldParam fp = new FieldParam(); + if(fieldHtmlType.equals("1")){ + fp.setSimpleText(Util.getIntValue(type,-1),typeDetial); + }else if(fieldHtmlType.equals("2")){ + fp.setText(); + }else if(fieldHtmlType.equals("3")){ + fp.setBrowser(Util.getIntValue(type,-1)); + }else if(fieldHtmlType.equals("4")){ + fp.setCheck(); + }else if(fieldHtmlType.equals("5")){ + fp.setSelect(); + }else if(fieldHtmlType.equals("6")){ + fp.setAttach(); + } + + temId = hfm.addField(fieldName, fp.getFielddbtype(), fieldHtmlType, type, ""+lableid, fieldOrder, isMand, isUse, groupId, dmlUrl); + //添加字段值isEdit + String isEdit = Util.null2String(fieldJson.getString("isEdit"),"1"); + formFieldMapper.updateHrmFormField(isEdit,temId+"",groupId); + }else{ + //只允许更改显示属性,数据库层面的不允许修改 + hfm.editField(fieldId, ""+lableid, fieldOrder, isMand, isUse, groupId); + //添加字段值isEdit + String isEdit = Util.null2String(fieldJson.getString("isEdit"),"1"); + formFieldMapper.updateHrmFormField(isEdit,fieldId,groupId); + } + + if(fieldHtmlType.equals("5")){ + List lsSelectOption = fieldBean.getFieldTypeBean().getLsSelectOption(); + hfm.checkSelectField(temId, lsSelectOption); + } + }catch (Exception e) { + writeLog(e); + } + } + + private void save(FieldBean fieldBean, String groupId){ try { HrmUtil hrmUtil = new HrmUtil(); diff --git a/src/main/java/com/engine/hrm/cmd/organization/GetDepartmentFormFieldCmd.java b/src/main/java/com/engine/hrm/cmd/organization/GetDepartmentFormFieldCmd.java index f32e54e..5dd2b6e 100644 --- a/src/main/java/com/engine/hrm/cmd/organization/GetDepartmentFormFieldCmd.java +++ b/src/main/java/com/engine/hrm/cmd/organization/GetDepartmentFormFieldCmd.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper; import weaver.general.Util; import weaver.hrm.User; import weaver.hrm.company.DepartmentComInfo; @@ -24,6 +25,8 @@ import com.engine.hrm.util.HrmOrganizationUtil; public class GetDepartmentFormFieldCmd extends AbstractCommonCommand> { + private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class); + public GetDepartmentFormFieldCmd(Map params, User user) { this.user = user; this.params = params; @@ -84,6 +87,13 @@ public class GetDepartmentFormFieldCmd extends AbstractCommonCommand> { + private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class); + public GetSubCompanyFormFieldCmd(Map params, User user) { this.user = user; this.params = params; @@ -74,7 +78,15 @@ public class GetSubCompanyFormFieldCmd extends AbstractCommonCommand> { + private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class); + + private final Logger log = aiyh.utils.Util.getLogger(); + public GetFieldDefinedCmd(Map params, User user) { this.user = user; this.params = params; @@ -191,6 +198,14 @@ public class GetFieldDefinedCmd extends AbstractCommonCommand groupId:%s fieldId:%s",groupId,fieldid)); + if(groupId == 6 || groupId == 7) { + recordInfo.put("isEdit", formFieldMapper.queryIsEdit(fieldid, groupId)); + } + log.info("recordInfo ==>"+ JSON.toJSONString(recordInfo)); + if (encryptEnable && ((fieldhtmltype.equals("1")||fieldhtmltype.equals("2")) && !issystem.equals("1")) ) { //只支持单行文本,多行文本 String tablename = "hrmsubcompanydefined"; diff --git a/src/main/java/com/engine/hrm/cmd/subcompanyfielddefined/SaveFieldDefinedCmd.java b/src/main/java/com/engine/hrm/cmd/subcompanyfielddefined/SaveFieldDefinedCmd.java index 37b0455..ec53258 100644 --- a/src/main/java/com/engine/hrm/cmd/subcompanyfielddefined/SaveFieldDefinedCmd.java +++ b/src/main/java/com/engine/hrm/cmd/subcompanyfielddefined/SaveFieldDefinedCmd.java @@ -17,6 +17,8 @@ import com.engine.core.interceptor.CommandContext; import com.engine.hrm.entity.FieldBean; import com.engine.hrm.entity.FieldSelectOptionBean; import com.engine.hrm.util.HrmUtil; +import org.apache.log4j.Logger; +import weaver.bokang.xiao.tbxc.mapper.FormFieldMapper; import weaver.conn.RecordSet; import weaver.docs.docs.FieldParam; import weaver.general.LabelUtil; @@ -36,6 +38,10 @@ import weaver.systeminfo.SystemEnv; */ public class SaveFieldDefinedCmd extends AbstractCommonCommand>{ + private final FormFieldMapper formFieldMapper = aiyh.utils.Util.getMapper(FormFieldMapper.class); + + private final Logger log = aiyh.utils.Util.getLogger(); + private SimpleBizLogger logger; public SaveFieldDefinedCmd(Map params, User user) { @@ -120,7 +126,13 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand"+groupId); + if("6".equals(groupId) || "7".equals(groupId)){ + this.save(fieldBean,groupId,records.getJSONObject(i)); + }else { + this.save(fieldBean, groupId); + } } HrmFieldComInfo.removeFieldCache(); //同步分部数据到矩阵 @@ -133,7 +145,84 @@ public class SaveFieldDefinedCmd extends AbstractCommonCommand保存更新方法 + * @author bokang.xiao + * @param fieldBean 字段信息实体类 + * @param groupId 组id + * @param fieldJson 字段JSON信息 + */ + private void save(FieldBean fieldBean, String groupId,JSONObject fieldJson){ + try { + HrmUtil hrmUtil = new HrmUtil(); + HrmDeptFieldManagerE9 hfm = new HrmDeptFieldManagerE9(4); + + String fieldId = Util.null2String(fieldBean.getId()); + String fieldLabel = Util.null2String(fieldBean.getFieldlabel()); + String fieldName = Util.null2String(fieldBean.getFieldname()); + String fieldHtmlType = ""; + String type = ""; + String typeDetial = ""; + String dmlUrl = ""; + if(fieldBean.getFieldTypeBean()!=null){ + fieldHtmlType = Util.null2String(fieldBean.getFieldTypeBean().getFieldHtmlType()); + type = Util.null2String(fieldBean.getFieldTypeBean().getFieldType()); + if(fieldHtmlType.equals("1")||fieldHtmlType.equals("2")){ + typeDetial = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam()); + } else if(fieldHtmlType.equals("66") || fieldHtmlType.equals("67")){ + dmlUrl = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam()); + } else if (type.equals("161") || type.equals("162") || type.equals("256")|| type.equals("257")) { + dmlUrl = Util.null2String(fieldBean.getFieldTypeBean().getOtherParam()); + } + } + + String isUse = Util.null2String(fieldBean.getEnable(),"0"); + String isMand = Util.null2String(fieldBean.getRequired(),"0"); + String fieldOrder = Util.null2String(fieldBean.getKey()); + + int temId = Util.getIntValue(fieldId,-1); + //int lableid = hrmUtil.getFieldLabelId(fieldLabel); + int lableid = new LabelUtil().getLabelId(fieldLabel); + + if(Util.null2String(fieldId).length()==0){ + FieldParam fp = new FieldParam(); + if(fieldHtmlType.equals("1")){ + fp.setSimpleText(Util.getIntValue(type,-1),typeDetial); + }else if(fieldHtmlType.equals("2")){ + fp.setText(); + }else if(fieldHtmlType.equals("3")){ + fp.setBrowser(Util.getIntValue(type,-1)); + }else if(fieldHtmlType.equals("4")){ + fp.setCheck(); + }else if(fieldHtmlType.equals("5")){ + fp.setSelect(); + }else if(fieldHtmlType.equals("6")){ + fp.setAttach(); + } + + temId = hfm.addField(fieldName, fp.getFielddbtype(), fieldHtmlType, type, ""+lableid, fieldOrder, isMand, isUse, groupId, dmlUrl); + //添加字段值isEdit + String isEdit = Util.null2String(fieldJson.getString("isEdit"),"1"); + formFieldMapper.updateHrmFormField(isEdit,temId+"",groupId); + }else{ + //只允许更改显示属性,数据库层面的不允许修改 + hfm.editField(fieldId, ""+lableid, fieldOrder, isMand, isUse, groupId); + //添加字段值isEdit + String isEdit = Util.null2String(fieldJson.getString("isEdit"),"1"); + formFieldMapper.updateHrmFormField(isEdit,fieldId,groupId); + } + + if(fieldHtmlType.equals("5")){ + List lsSelectOption = fieldBean.getFieldTypeBean().getLsSelectOption(); + hfm.checkSelectField(temId, lsSelectOption); + } + }catch (Exception e) { + writeLog(e); + } + } + + private void save(FieldBean fieldBean, String groupId){ try { HrmUtil hrmUtil = new HrmUtil(); diff --git a/src/main/java/weaver/bokang/xiao/tbxc/mapper/FormFieldMapper.java b/src/main/java/weaver/bokang/xiao/tbxc/mapper/FormFieldMapper.java index 8b82f66..45ee62a 100644 --- a/src/main/java/weaver/bokang/xiao/tbxc/mapper/FormFieldMapper.java +++ b/src/main/java/weaver/bokang/xiao/tbxc/mapper/FormFieldMapper.java @@ -1,8 +1,38 @@ -package weaver.bokang.xiao.tbxc.mapper;/** - *@ClassName FormFieldMapper - *@Author 肖博亢 - *@Date 2023/4/26 17:22 - *@Description

+package weaver.bokang.xiao.tbxc.mapper; + +import aiyh.utils.annotation.recordset.ParamMapper; +import aiyh.utils.annotation.recordset.Select; +import aiyh.utils.annotation.recordset.SqlMapper; +import aiyh.utils.annotation.recordset.Update; + +/** + * @ClassName FormFieldMapper + * @Author 肖博亢 + * @Date 2023/4/26 17:22 + * @Description

**/ -public class FormFieldMapper { +@SqlMapper +public interface FormFieldMapper { + + /** + *

更新字段列信息

+ * @param isEdit 值信息 + * @param formFieldId 字段id + * @param groupId 组id + * @return 更新结果 + */ + @Update("update hrm_formfield set is_edit = #{isEdit} where fieldid = #{formFieldId} and groupid = #{groupId}") + boolean updateHrmFormField(@ParamMapper("isEdit") String isEdit, + @ParamMapper("formFieldId") String formFieldId, + @ParamMapper("groupId") String groupId); + + /** + *

查询isEdit的值

+ * @param formFieldId 字段id + * @param groupId 组id + * @return 值 + */ + @Select("select is_edit from hrm_formfield where fieldid = #{formFieldId} and groupid = #{groupId}") + String queryIsEdit(@ParamMapper("formFieldId") String formFieldId, + @ParamMapper("groupId") int groupId); } diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/entity/AssignmentEntity.java b/src/main/java/weaver/bokang/xiao/zscq/config/entity/AssignmentEntity.java index 9f01e39..5e1b59a 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/entity/AssignmentEntity.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/entity/AssignmentEntity.java @@ -1,5 +1,6 @@ package weaver.bokang.xiao.zscq.config.entity; +import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn; import lombok.Data; /** @@ -12,20 +13,26 @@ import lombok.Data; public class AssignmentEntity { /** 赋值字段 */ + @SqlOracleDbFieldAnn("ASSIGNMENT_FIELD") private String assignmentField; /** 值选择 */ + @SqlOracleDbFieldAnn("VALUE_SELECT") private Integer valueSelect; /** 源字段 */ + @SqlOracleDbFieldAnn("SOURCE_FIELD") private String sourceField; /** 赋值字段名 */ + @SqlOracleDbFieldAnn("ASSIGNMENT_FIELD_NAME") private String assignmentFieldName; /** 源字段名 */ + @SqlOracleDbFieldAnn("SOURCE_FIELD_NAME") private String sourceFieldName; /** 文本框 */ - private String context; + @SqlOracleDbFieldAnn("CUS_CONTEXT") + private String cusContext; } diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/entity/ConditionEntity.java b/src/main/java/weaver/bokang/xiao/zscq/config/entity/ConditionEntity.java index 4509aea..afe6fff 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/entity/ConditionEntity.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/entity/ConditionEntity.java @@ -1,5 +1,6 @@ package weaver.bokang.xiao.zscq.config.entity; +import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn; import lombok.Data; /** @@ -12,26 +13,34 @@ import lombok.Data; public class ConditionEntity { /** 条件类型 */ + @SqlOracleDbFieldAnn("CONDITION_TYPE") private Integer conditionType; /** 条件 */ + @SqlOracleDbFieldAnn("CONDITION_VALUE") private Integer conditionValue; /** 源字段 */ + @SqlOracleDbFieldAnn("CONDITION_SOURCE_FIELD") private String conditionSourceField; /** 值类型 */ + @SqlOracleDbFieldAnn("VALUE_TYPE") private Integer valueType; /** 目标字段 */ + @SqlOracleDbFieldAnn("CONDITION_TARGET_FIELD") private String conditionTargetField; /** 源字段名 */ + @SqlOracleDbFieldAnn("CONDITION_SOURCE_FIELD_NAME") private String conditionSourceFieldName; /** 目标字段名 */ + @SqlOracleDbFieldAnn("CONDITION_TARGET_FIELD_NAME") private String conditionTargetFieldName; /** 文本框 */ + @SqlOracleDbFieldAnn("CUS_TEXT") private String cusText; } diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/entity/UpdateModeConf.java b/src/main/java/weaver/bokang/xiao/zscq/config/entity/UpdateModeConf.java index 8489d61..e859310 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/entity/UpdateModeConf.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/entity/UpdateModeConf.java @@ -1,5 +1,6 @@ package weaver.bokang.xiao.zscq.config.entity; +import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn; import lombok.Data; import java.util.List; @@ -14,30 +15,39 @@ import java.util.List; public class UpdateModeConf { /** 源建模 */ + @SqlOracleDbFieldAnn("SOURCE_MODE") private String sourceMode; /** 触发建模 */ + @SqlOracleDbFieldAnn("TARGET_MODE") private String targetMode; /** 说明 */ + @SqlOracleDbFieldAnn("DESCRIPTION") private String description; /** 唯一标识 */ + @SqlOracleDbFieldAnn("UNIQUE_CODE") private String uniqueCode; /** 源表名 */ + @SqlOracleDbFieldAnn("SOURCE_TABLE_NAME") private String sourceTableName; /** 触发表名 */ + @SqlOracleDbFieldAnn("TARGET_TABLE_NAME") private String targetTableName; /** 数据写入方式 */ + @SqlOracleDbFieldAnn("DATA_IN_TYPE") private Integer dataInType; /** 自定义操作类全路径 */ + @SqlOracleDbFieldAnn("OPERATE_PATH") private String operatePath; /** 无条件触发 */ + @SqlOracleDbFieldAnn("NO_RULE") private Integer noRule; /** 条件列表 */ diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/mapper/UpdateModeMapper.java b/src/main/java/weaver/bokang/xiao/zscq/config/mapper/UpdateModeMapper.java index 8c9dd44..bb68a40 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/mapper/UpdateModeMapper.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/mapper/UpdateModeMapper.java @@ -29,6 +29,17 @@ public interface UpdateModeMapper { }) List queryUpdateModeConfByFormId(@ParamMapper("formId")String formId); + /** + *

通过formId查询相关配置信息

+ * @return 配置列表 + */ + @Select("select * from uf_update_mode_conf") + @CollectionMappings({ + @CollectionMapping(property = "conditionList", column = "id", id = @Id(value = Integer.class, methodId = 1)), + @CollectionMapping(property = "assignmentList", column = "id", id = @Id(value = Integer.class, methodId = 2)), + }) + List queryUpdateModeConf(); + /** *

查询条件列表

* @param mainId 主数据id diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/process/ConditionTargetProcess.java b/src/main/java/weaver/bokang/xiao/zscq/config/process/ConditionTargetProcess.java index 0161001..12d66eb 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/process/ConditionTargetProcess.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/process/ConditionTargetProcess.java @@ -71,13 +71,61 @@ public class ConditionTargetProcess { */ @MethodRuleNo(value = 1, desc = "不等于") public static String noEquals(Map whereParam,Map param,String whereSql) { - String sourceFieldName = Util.null2String(param.get("sourceValue")); String conditionValue = Util.null2String(param.get("conditionValue")); String targetFieldName = Util.null2String(param.get("targetFieldName")); - String targetStr = " and "+sourceFieldName+" <> #{whereParam."+targetFieldName+"}"; + String targetStr = " and "+targetFieldName+" <> #{whereParam."+targetFieldName+"}"; whereSql += targetStr; whereParam.put(targetFieldName,conditionValue); return whereSql; } + /** + *

目标建模不等于处理方法

+ * @param whereParam 条件参数 + * @param param 参数信息 + * @param whereSql 条件sql + * @return 条件sql + */ + @MethodRuleNo(value = 6, desc = "in") + public static String in(Map whereParam,Map param,String whereSql) { + String conditionValue = Util.null2String(param.get("conditionValue")); + String targetFieldName = Util.null2String(param.get("targetFieldName")); + String targetStr = " and "+targetFieldName+" in ( $t{whereParam."+targetFieldName+"})"; + whereSql += targetStr; + whereParam.put(targetFieldName,conditionValue); + return whereSql; + } + + /** + *

目标建模不等于处理方法

+ * @param whereParam 条件参数 + * @param param 参数信息 + * @param whereSql 条件sql + * @return 条件sql + */ + @MethodRuleNo(value = 7, desc = "not in") + public static String notIn(Map whereParam,Map param,String whereSql) { + String conditionValue = Util.null2String(param.get("conditionValue")); + String targetFieldName = Util.null2String(param.get("targetFieldName")); + String targetStr = " and "+targetFieldName+" not in ( $t{whereParam."+targetFieldName+"})"; + whereSql += targetStr; + whereParam.put(targetFieldName,conditionValue); + return whereSql; + } + + /** + *

目标建模不等于处理方法

+ * @param whereParam 条件参数 + * @param param 参数信息 + * @param whereSql 条件sql + * @return 条件sql + */ + @MethodRuleNo(value = 8, desc = "自定义sql") + public static String cusSql(Map whereParam,Map param,String whereSql) { + String conditionValue = Util.null2String(param.get("conditionValue")); + String targetStr = " and "+Util.sbc2dbcCase(conditionValue); + whereSql += targetStr; + return whereSql; + } + } diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/process/ConditionValueProcess.java b/src/main/java/weaver/bokang/xiao/zscq/config/process/ConditionValueProcess.java index f05f074..f99c2af 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/process/ConditionValueProcess.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/process/ConditionValueProcess.java @@ -67,5 +67,32 @@ public class ConditionValueProcess { return !sourceValue.equals(value); } + /** + *

源建模不等于处理方法

+ * @param sourceValue 源建模值 + * @param value 目标值 + * @return 是否符合 + */ + @MethodRuleNo(value = 6, desc = "in") + public static boolean in(String sourceValue, String value) { + if("".equals(sourceValue) || "".equals(value)){ + return false; + } + String tempStr = ","+value+","; + sourceValue = "," + sourceValue + ","; + return tempStr.contains(sourceValue); + } + + /** + *

源建模不等于处理方法

+ * @param sourceValue 源建模值 + * @param value 目标值 + * @return 是否符合 + */ + @MethodRuleNo(value = 7, desc = "not in") + public static boolean notIn(String sourceValue, String value) { + return !in(sourceValue, value); + } + } diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/process/DataTypeProcess.java b/src/main/java/weaver/bokang/xiao/zscq/config/process/DataTypeProcess.java index 55f2086..cac75ee 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/process/DataTypeProcess.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/process/DataTypeProcess.java @@ -69,7 +69,7 @@ public class DataTypeProcess { whereSql = whereSql.replaceFirst(" and "," where "); } updateSql = updateSql + whereSql; - logger.info("updateSql ==>"+updateSql); + logger.info(String.format("updateSql ==> %s updateParam ==> %s whereParam ==> %s",updateSql,updateParam,whereParam)); return UPDATE_MODE_MAPPER.executeUpdateCusSql(updateSql, updateParam, whereParam); } @@ -90,7 +90,7 @@ public class DataTypeProcess { String updateSql = buildUpdateSql(tableName, updateParam); String whereSql = DataTypeProcess.buildWhereSql(whereParam); updateSql = updateSql + " " + whereSql; - logger.info("updateSql ==>"+updateSql); + logger.info(String.format("updateSql ==> %s updateParam ==> %s whereParam ==> %s",updateSql,updateParam,whereParam)); return UPDATE_MODE_MAPPER.executeUpdateCusSql(updateSql,updateParam,whereParam); } @@ -142,6 +142,30 @@ public class DataTypeProcess { return insert(updateParam,whereParam,param) && cusOperate(updateParam,whereParam,param); } + /** + *

更新并执行自定义处理方法

+ * @param updateParam 更新参数 + * @param whereParam 条件参数 + * @param param 表参数 + * @return 执行结果 + */ + @MethodRuleNo(value = 5,desc = "执行自定义操作并更新") + public static boolean updateAndCus(Map updateParam, Map whereParam,Map param) { + return cusOperate(updateParam,whereParam,param) && update(updateParam,whereParam,param); + } + + /** + *

插入并执行自定义处理方法

+ * @param updateParam 更新参数 + * @param whereParam 条件参数 + * @param param 表参数 + * @return 执行结果 + */ + @MethodRuleNo(value = 6,desc = "执行自定义操作并插入") + public static boolean insertAndCus(Map updateParam, Map whereParam,Map param) { + return cusOperate(updateParam,whereParam,param) && insert(updateParam,whereParam,param); + } + /** *

构建更新sql语句

* @param tableName 表名 diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/process/ValueSelectProcess.java b/src/main/java/weaver/bokang/xiao/zscq/config/process/ValueSelectProcess.java index e0a570c..318b1cc 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/process/ValueSelectProcess.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/process/ValueSelectProcess.java @@ -60,7 +60,7 @@ public class ValueSelectProcess { */ @MethodRuleNo(value = 0, desc = "默认值") public static String defaultValue(Map modeMap,AssignmentEntity assignment) { - return assignment.getContext(); + return assignment.getCusContext(); } /** @@ -82,7 +82,7 @@ public class ValueSelectProcess { */ @MethodRuleNo(value = 2, desc = "自定义sql") public static String cusSql(Map modeMap,AssignmentEntity assignment) { - String cusSqlStr = Util.null2String(assignment.getContext()); + String cusSqlStr = Util.null2String(assignment.getCusContext()); cusSqlStr = Util.dbc2sbcCase(cusSqlStr); if(StringUtils.isBlank(cusSqlStr)){ throw new CustomerException("选择自定义sql时,sql字符串不能为空"); diff --git a/src/main/java/weaver/bokang/xiao/zscq/config/service/ModeChangeService.java b/src/main/java/weaver/bokang/xiao/zscq/config/service/ModeChangeService.java index 3d3e562..b7e920b 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/config/service/ModeChangeService.java +++ b/src/main/java/weaver/bokang/xiao/zscq/config/service/ModeChangeService.java @@ -9,6 +9,7 @@ import weaver.bokang.xiao.zscq.config.entity.UpdateModeConf; import weaver.bokang.xiao.zscq.config.function.ConditionFunction; import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper; import weaver.bokang.xiao.zscq.config.process.*; +import weaver.bokang.xiao.zscq.store.TableNameStore; import java.util.HashMap; import java.util.List; @@ -33,23 +34,39 @@ public class ModeChangeService { *

更新其他建模信息

* @param modeMap 模块数据 * @param formId 表单id + * @param triggerType 触发方式 0:无条件触发; 1:建模更新触发; 2:其他触发 */ - public void changeOtherMode(Map modeMap, String formId){ - List updateModeConfList = updateModeMapper.queryUpdateModeConfByFormId(formId); + public void changeOtherMode(Map modeMap, String formId,int triggerType){ + Map> triggerStore = TableNameStore.getInstance().getTriggerStore(); + List updateModeConfList = triggerStore.get(formId); if(Objects.isNull(updateModeConfList) || updateModeConfList.isEmpty()){ logger.error(String.format("此表单建模[%s] 未配置相关更新信息,请检查!!!",formId)); return; } - logger.info("配置信息 updateModeConfList==>"+ JSON.toJSONString(updateModeConfList)); + List collect = updateModeConfList.stream().filter(item -> item.getNoRule() == triggerType).collect(Collectors.toList()); + if(collect.isEmpty()){ + logger.error(String.format("此表单建模[%s] 未配置相关更新信息,请检查!!!",formId)); + return; + } + doChange(modeMap,collect); + } + + /** + *

更新其他表数据的具体方法

+ * @param modeMap 源建模数据 + * @param updateModeConfList 配置参数列表 + */ + private void doChange(Map modeMap,List updateModeConfList){ for (UpdateModeConf updateModeConf : updateModeConfList) { List conditionList = updateModeConf.getConditionList(); List assignmentList = updateModeConf.getAssignmentList(); Integer dataInType = updateModeConf.getDataInType(); Integer noRule = updateModeConf.getNoRule(); - if(noRule == 0 && conditionList.isEmpty()){ + if(noRule == 1 && conditionList.isEmpty()){ logger.error(String.format("没有条件设置,不允许建模 %s 更新",updateModeConf.getTargetTableName())); continue; } + logger.info(String.format("处理配置 deal config [%s - %s]",updateModeConf.getUniqueCode(),updateModeConf.getDescription())); //条件sql String whereSql = ""; //条件数据 @@ -71,12 +88,13 @@ public class ModeChangeService { String sourceValue = Util.null2String(modeMap.get(sourceCondition.getConditionSourceFieldName())); String conditionValue = valueFunction.apply(modeMap, sourceCondition); Boolean result = conditionFunction.apply(sourceValue, conditionValue); - if (result) { + if (!result) { flag = true; break; } } if (flag) { + logger.info("源建模条件判断不通过,此条数据跳过 sourceMode condition fail !!! "+JSON.toJSONString(modeMap)); continue; } } @@ -113,4 +131,6 @@ public class ModeChangeService { logger.info("更新结果 executeFlag ==>"+executeFlag); } } + + } diff --git a/src/main/java/weaver/bokang/xiao/zscq/expand/DataControlExpand.java b/src/main/java/weaver/bokang/xiao/zscq/expand/DataControlExpand.java index 32a541f..5ae68ee 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/expand/DataControlExpand.java +++ b/src/main/java/weaver/bokang/xiao/zscq/expand/DataControlExpand.java @@ -97,7 +97,7 @@ public class DataControlExpand extends AbstractModeExpandJavaCodeNew { queryParam.put("fieldValue",dataId); Map modeData = modeMapper.queryModeDataInfo(tableName, queryParam); if(Objects.nonNull(modeData)){ - modeChangeService.changeOtherMode(modeData,formId); + modeChangeService.changeOtherMode(modeData,formId,1); } } diff --git a/src/main/java/weaver/bokang/xiao/zscq/fun/WorkflowOverOperate.java b/src/main/java/weaver/bokang/xiao/zscq/fun/WorkflowOverOperate.java index 694534e..a99f5d2 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/fun/WorkflowOverOperate.java +++ b/src/main/java/weaver/bokang/xiao/zscq/fun/WorkflowOverOperate.java @@ -3,6 +3,7 @@ package weaver.bokang.xiao.zscq.fun; import aiyh.utils.Util; import weaver.bokang.xiao.zscq.config.function.CusOperateInterface; import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper; +import weaver.bokang.xiao.zscq.mapper.StatusMapper; import weaver.hrm.User; import weaver.workflow.workflow.WfForceOver; @@ -21,6 +22,8 @@ public class WorkflowOverOperate implements CusOperateInterface { private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class); + private final StatusMapper statusMapper = Util.getMapper(StatusMapper.class); + @Override public void execute(Map whereParam, Map param, Map pathParam) { logger.info(String.format("WorkflowOverOperate 自定义处理 whereParam[%s],param:[%s],pathParam:[%s]",whereParam,param,pathParam)); @@ -35,6 +38,11 @@ public class WorkflowOverOperate implements CusOperateInterface { if(Objects.nonNull(modeData)){ String workflowField = Util.null2String(pathParam.get("workflowField")); String requestId = Util.null2String(modeData.get(workflowField)); + int status = statusMapper.queryWorkflowStatus(requestId); + if(status == 3){ + logger.error(String.format("此流程已归档,不再执行强制归档操作 this workflow is over!!! requestId:%s ",requestId)); + return; + } logger.info("流程强制归档 ==>"+requestId); //流程强制归档 WfForceOver wfForceOver = new WfForceOver(); diff --git a/src/main/java/weaver/bokang/xiao/zscq/fun/WorkflowRepossessedSign.java b/src/main/java/weaver/bokang/xiao/zscq/fun/WorkflowRepossessedSign.java index 5e53421..dcec3ad 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/fun/WorkflowRepossessedSign.java +++ b/src/main/java/weaver/bokang/xiao/zscq/fun/WorkflowRepossessedSign.java @@ -1,8 +1,100 @@ -package weaver.bokang.xiao.zscq.fun;/** - *@ClassName WorkflowRepossessedSign - *@Author 肖博亢 - *@Date 2023/4/24 11:11 - *@Description

+package weaver.bokang.xiao.zscq.fun; + +import aiyh.utils.Util; +import com.api.bokang.xiao.zscq.service.impl.ReserveServiceImpl; +import weaver.bokang.xiao.zscq.config.function.CusOperateInterface; +import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper; +import weaver.conn.RecordSet; +import weaver.hrm.User; +import weaver.workflow.workflow.RequestForceDrawBack; +import weaver.workflow.workflow.WfForceDrawBack; +import weaver.workflow.workflow.WfFunctionManageUtil; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * @ClassName WorkflowRepossessedSign + * @Author 肖博亢 + * @Date 2023/4/24 11:11 + * @Description

**/ -public class WorkflowRepossessedSign { +public class WorkflowRepossessedSign implements CusOperateInterface { + + private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class); + + private final ReserveServiceImpl reserveService = new ReserveServiceImpl(); + + @Override + public void execute(Map whereParam, Map param, Map pathParam) { + logger.info(String.format("WorkflowRepossessedSign 自定义处理 whereParam[%s],param:[%s],pathParam:[%s]",whereParam,param,pathParam)); + String tableName = Util.null2String(param.get("tableName")); + String whereSql = Util.null2String(param.get("whereSql")); + if(!"".equals(whereSql)){ + whereSql = whereSql.replaceFirst(" and "," where "); + } + String querySql = "select * from " + tableName +whereSql; + Map modeData = updateModeMapper.executeCusSqlMap(querySql, whereParam,new HashMap<>()); + logger.info("modeData ==>"+modeData); + if(Objects.nonNull(modeData)){ + String workflowField = Util.null2String(pathParam.get("workflowField")); + String requestId = Util.null2String(modeData.get(workflowField)); + logger.info("流程强制收回 ==>"+requestId); + //流程强制收回 + reserveService.doRepossessedSign(Util.getIntValue(requestId),new User(1)); + //this.doRepossessedSign2(Util.getIntValue(requestId),new User(1)); + } + } + + /** + *

流程强制收回 + * @param requestId 流程id + * @param user 用户信息 + * @return 操作结果 + */ + public boolean doRepossessedSign2(int requestId,User user){ + WfFunctionManageUtil wfFunctionManageUtil = new WfFunctionManageUtil(); + //初始化 + RequestForceDrawBack requestForceDrawBack = new RequestForceDrawBack(); + WfForceDrawBack wfForceDrawBack = new WfForceDrawBack(); + if(requestId != -1){ + RecordSet recordSet = new RecordSet(); + //从日志中去找最后一个操作者 + recordSet.executeSql("select max(logid), operator,operatortype from workflow_requestlog where requestId=" + requestId + " and (logtype='2' or logtype='0' or logtype='3' or logtype='e') and exists(select 1 from workflow_currentoperator where requestId=workflow_requestlog.requestId and userid=workflow_requestlog.operator and usertype=workflow_requestlog.operatortype and isremark='2' and preisremark='0' and operatedate is not null and operatedate>' ') group by operator,operatortype order by max(logid) desc"); + int tempUser = -1; + int tempUserType = -1; + if (recordSet.next()) { + tempUser = Util.getIntValue(recordSet.getString("operator")); + tempUserType = Util.getIntValue(recordSet.getString("operatortype"), 0); + }else{ + recordSet.executeSql("select userid,usertype from workflow_currentoperator where requestId = " + requestId + " and isremark = '2' and preisremark='0' and operatedate is not null and operatedate>' ' order by operatedate desc ,operatetime desc"); + if (recordSet.next()) { + tempUser = recordSet.getInt("userid"); + tempUserType = recordSet.getInt("usertype"); + } + } + if(tempUser == -1 && tempUserType == -1){ + logger.error(String.format("流程 requestId:[%s] 操作者 operateInfo no find 流程可能未归档 !!!",requestId)); + return false; + } + //提交时针对流程再作一次权限判断 + boolean canForceDrawBack = RequestForceDrawBack.isHavePurview(user.getUID(), requestId, true); + if (canForceDrawBack && wfFunctionManageUtil.haveOtherOperationRight(requestId)) { + //int result = requestForceDrawBack.foreceDrawBack(user, requestId, true, tempUser, tempUserType); + ArrayList requestIds = new ArrayList<>(); + requestIds.add(requestId+""); + wfForceDrawBack.doForceDrawBack(requestIds,new User(1),-1,-1); + logger.info(String.format("流程 requestId:[%s] 撤回结果 drawBack result:[%d] message:[%s]",requestId,111,requestForceDrawBack.getMessage())); + //return result == 1; + return true; + }else{ + return false; + } + }else{ + return false; + } + } + } diff --git a/src/main/java/weaver/bokang/xiao/zscq/mapper/StatusMapper.java b/src/main/java/weaver/bokang/xiao/zscq/mapper/StatusMapper.java index 8e3616d..f424845 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/mapper/StatusMapper.java +++ b/src/main/java/weaver/bokang/xiao/zscq/mapper/StatusMapper.java @@ -1,6 +1,7 @@ package weaver.bokang.xiao.zscq.mapper; import aiyh.utils.annotation.recordset.ParamMapper; +import aiyh.utils.annotation.recordset.Select; import aiyh.utils.annotation.recordset.SqlMapper; import aiyh.utils.annotation.recordset.Update; @@ -19,8 +20,16 @@ public interface StatusMapper { * @param userIds 用户id集合 * @return 操作结果 */ - @Update("update workflow_currentoperator set viewtype = -2,isremark = 2 " + + @Update("update workflow_currentoperator set isremark = 2 " + "where REQUESTID = #{requestId} and userid in ($t{userIds}) and isremark = 8") boolean changeWorkflowStatus(@ParamMapper("requestId")String requestId,@ParamMapper("userIds") String userIds); + /** + *

查询当前流程状态

+ * @param requestId 流程id + * @return 流程状态 + */ + @Select("select currentnodetype from workflow_requestbase where requestid = #{requestId}") + int queryWorkflowStatus(@ParamMapper("requestId")String requestId); + } diff --git a/src/main/java/weaver/bokang/xiao/zscq/store/TableNameStore.java b/src/main/java/weaver/bokang/xiao/zscq/store/TableNameStore.java index 7e9e532..5060621 100644 --- a/src/main/java/weaver/bokang/xiao/zscq/store/TableNameStore.java +++ b/src/main/java/weaver/bokang/xiao/zscq/store/TableNameStore.java @@ -6,6 +6,8 @@ import lombok.Getter; import org.apache.log4j.Logger; import weaver.bokang.xiao.xhny_report.entity.pojo.CompanyEntity; import weaver.bokang.xiao.xhny_report.mapper.VendorMapper; +import weaver.bokang.xiao.zscq.config.entity.UpdateModeConf; +import weaver.bokang.xiao.zscq.config.mapper.UpdateModeMapper; import weaver.general.StaticObj; import weaver.interfaces.datasource.DataSource; @@ -30,9 +32,31 @@ public class TableNameStore { private final Map tableNameStore = new HashMap<>(); + private final Map> triggerStore = new HashMap<>(); + + private final UpdateModeMapper updateModeMapper = Util.getMapper(UpdateModeMapper.class); + private static final Logger logger = Util.getLogger(); - private TableNameStore(){} + private TableNameStore(){init();} + + private void init(){ + try { + triggerStore.clear(); + List updateModeConfList = updateModeMapper.queryUpdateModeConf(); + if (Objects.nonNull(updateModeConfList) && !updateModeConfList.isEmpty()) { + Map> collect = updateModeConfList.stream().collect(Collectors.groupingBy(UpdateModeConf::getSourceMode)); + triggerStore.putAll(collect); + } + logger.info(String.format("TableNameStore init success!!! triggerStore:%s updateModeConfList:%s", JSON.toJSONString(triggerStore), JSON.toJSONString(updateModeConfList))); + }catch (Exception e){ + logger.error("TableNameStore init error !!!"+Util.getErrString(e)); + } + } + + public void refresh(){ + this.init(); + } public static TableNameStore getInstance(){ return VendorStoreHolder.VENDOR_STORE; diff --git a/src/main/resources/ajzx/ContractList.jsp b/src/main/resources/ajzx/ContractList.jsp deleted file mode 100644 index 9070046..0000000 --- a/src/main/resources/ajzx/ContractList.jsp +++ /dev/null @@ -1,499 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" %> -<%@ include file="/systeminfo/init_wev8.jsp"%> -<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%> -<%@ taglib uri="/WEB-INF/tld/browser.tld" prefix="brow"%> - -<%@ page import="weaver.file.Prop" %> -<%@ page import="weaver.hrm.HrmUserVarify" %> -<%@ page import="weaver.systeminfo.SystemEnv" %> - - - - - - - - - - - - - - - -<% - - String sqlwhere = " where 1=1 "; - - String subcompanyid1 = ResourceComInfo.getSubCompanyID(String.valueOf(user.getUID())); - - //是否采购部 - boolean isDep = false; - //是否是流程接收人 - boolean isShow = false; - //采购部的同事可以选择所有合同卡片;而本部门的人员(非采购部)只能选择本部门的合同卡片 - RecordSet_Dep.executeSql("select * from HrmDepartment where departmentname like '%采购%' and id="+user.getUserDepartment()); - if(RecordSet_Dep.next()) isDep = true; - - //是否合同流程接收人 - String sqlwhere_workflow = ""; - RecordSet_Dep.executeSql("select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()); - if(RecordSet_Dep.next()) isShow = true; - - if(!HrmUserVarify.checkUserRight("ContactInfo:Manager", user) && !HrmUserVarify.checkUserRight("ContactInfo:User", user) && !isShow && !isDep){ - response.sendRedirect("/notice/noright.jsp"); - } - - //如果是合同管理权限,则直接1=1 - if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user)){ - sqlwhere += " and 1=1"; - }else if(isShow && HrmUserVarify.checkUserRight("ContactInfo:User", user)){ - //如果是流程接收人,并且有合同查看权限 - sqlwhere += " and (requestid in (select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()+") or reqDeptId = '"+user.getUserDepartment()+"')"; - - }else if(HrmUserVarify.checkUserRight("ContactInfo:User", user)){ - //如果只有合同查看权限 - sqlwhere += " and reqDeptId = '"+user.getUserDepartment()+"'"; - - }else if(isShow){ - //如果只是流程接收人 - sqlwhere += " and requestid in (select distinct requestId from workflow_currentoperator where workflowid in (79,148,133,128,118,108,98,153,167,316,470,514,532,543,600,717,719,739,832,927,929) and userid="+user.getUID()+")"; - } - - //如果没有查看全部的权限,加分部条件 - if(!HrmUserVarify.checkUserRight("ContactInfoList:ALL", user)){ - if (!subcompanyid1.equals("0")) {sqlwhere += " and CrmContractInfo.subcompanyid1 = '"+subcompanyid1+"' ";} - } - String imagefilename = "/images/hdReport.gif"; - String titlename = SystemEnv.getHtmlLabelName(614, user.getLanguage()) + SystemEnv.getHtmlLabelName(527, user.getLanguage()); - String needfav = "1"; - String needhelp = ""; -%> - - <%@ include file="/systeminfo/TopTitle_wev8.jsp"%> - <%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp"%> - <% - RCMenu += "{" + SystemEnv.getHtmlLabelName(197, user.getLanguage()) + ",javascript:OnSearch(),_top} "; - RCMenuHeight += RCMenuHeightStep; - RCMenu += "{" + "Excel,javascript:ContractExport(),_top} "; - RCMenuHeight += RCMenuHeightStep; - RCMenu += "{" + SystemEnv.getHtmlLabelName(18363, user.getLanguage()) + ",javascript:_table.firstPage(),_self}"; - RCMenuHeight += RCMenuHeightStep; - RCMenu += "{" + SystemEnv.getHtmlLabelName(1258, user.getLanguage()) + ",javascript:_table.prePage(),_self}"; - RCMenuHeight += RCMenuHeightStep; - RCMenu += "{" + SystemEnv.getHtmlLabelName(1259, user.getLanguage()) + ",javascript:_table.nextPage(),_self}"; - RCMenuHeight += RCMenuHeightStep; - RCMenu += "{" + SystemEnv.getHtmlLabelName(18362, user.getLanguage()) + ",javascript:_table.lastPage(),_self}"; - RCMenuHeight += RCMenuHeightStep; - %> - <% - int pagenum = Util.getIntValue(request.getParameter("pagenum"), 1); - int perpage = Util.getPerpageLog(); - if (perpage <= 1) perpage = 10; - - String creator = Util.fromScreen(request.getParameter("creator"), user.getLanguage()); - String fromdate = Util.fromScreen(request.getParameter("fromdate"), user.getLanguage()); - String fromdate2 = Util.fromScreen(request.getParameter("fromdate2"), user.getLanguage()); - String enddate = Util.fromScreen(request.getParameter("enddate"), user.getLanguage()); - String enddate2 = Util.fromScreen(request.getParameter("enddate2"), user.getLanguage()); - String status_temp = Util.null2String(request.getParameter("status_temp")); - - String conNo = Util.fromScreen(request.getParameter("conNo"), user.getLanguage()); - String prNo = Util.fromScreen(request.getParameter("prNo"), user.getLanguage()); - String jpcNo = Util.fromScreen(request.getParameter("jpcNo"), user.getLanguage()); - String suppliersId = Util.fromScreen(request.getParameter("suppliersId"), user.getLanguage()); - String isOneSuppliers = Util.fromScreen(request.getParameter("isOneSuppliers"), user.getLanguage()); -// String reqDeptId = String.valueOf(user.getUserDepartment()); - String reqDeptId = Util.fromScreen(request.getParameter("reqDeptId"), user.getLanguage());; - //管理员组或采购部才能查询所有部门下合同,合同接收人查看接收的合同 -// if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user) || isShow) reqDeptId = Util.fromScreen(request.getParameter("reqDeptId"), user.getLanguage()); - String isOverdue = Util.fromScreen(request.getParameter("isOverdue"), user.getLanguage()); - String status = Util.fromScreen(request.getParameter("status"), user.getLanguage()); - String isOverdueNext = Util.fromScreen(request.getParameter("isOverdueNext"), user.getLanguage()); - String conType = Util.fromScreen(request.getParameter("conType"), user.getLanguage()); - - String name = Util.fromScreen(request.getParameter("name"), user.getLanguage()); - String subCompanyId = Util.fromScreen(request.getParameter("subCompanyId"), user.getLanguage()); - String reNewStatus = Util.fromScreen(request.getParameter("reNewStatus"), user.getLanguage()); - String conStatus = Util.fromScreen(request.getParameter("conStatus"), user.getLanguage()); - String contractName = Util.fromScreen(request.getParameter("contractName"), user.getLanguage()); - String csstatus = Util.fromScreen(request.getParameter("csstatus"), user.getLanguage()); - - int opentype = Util.getIntValue(request.getParameter("opentype"),-1); - - //String sqlwhere = " where status = '' "; - //if(!"".equals(status_temp)) sqlwhere += " and status in ("+status_temp+") "; - - if (!fromdate.equals("")) sqlwhere += " and startDate>='" + fromdate + "'"; - if (!fromdate2.equals("")) sqlwhere += " and startDate<='" + fromdate2 + "'"; - if (!enddate.equals("")) sqlwhere += " and enddate>='" + enddate + "'"; - if (!enddate2.equals("")) sqlwhere += " and enddate<='" + enddate2 + "'"; - if (!conNo.equals("")) sqlwhere += " and conNo like '%" + conNo + "%'"; - if (!prNo.equals("")) sqlwhere += " and prNo='" + prNo + "'"; - if (!jpcNo.equals("")) sqlwhere += " and jpcNo='" + jpcNo + "'"; - if(!"".equals(suppliersId)) sqlwhere += " and suppliersId=" + suppliersId; - if (!isOneSuppliers.equals("")) sqlwhere += " and isOneSuppliers='" + isOneSuppliers + "'"; - if (!"".equals(creator) && !"0".equals(creator)) sqlwhere += " and CrmContractInfo.creator=" + creator; - if (!reqDeptId.equals("")) sqlwhere += " and reqDeptId=" + reqDeptId; - if (!isOverdue.equals("")) sqlwhere += " and isOverdue='" + isOverdue + "'"; - if (!status.equals("")) sqlwhere += " and CrmContractInfo.status='" + status + "'"; - if (!isOverdueNext.equals("")) sqlwhere += " and isOverdueNext='" + isOverdueNext + "'"; - if (!conType.equals("")) sqlwhere += " and conType='" + conType + "'"; - if (!csstatus.equals("")) sqlwhere += " and CrmSalesContractInfo.status='" + csstatus + "'"; - - if (!name.equals("")) sqlwhere += " and name like '%" + name + "%'"; - if (!subCompanyId.equals("")) sqlwhere += " and CrmContractInfo.subcompanyid1 = '" + subCompanyId + "'"; - if (!reNewStatus.equals("")) sqlwhere += " and conStatus = '" + reNewStatus + "'"; - - if (!contractName.equals("")) sqlwhere += " and contractName like '%" + contractName + "%'"; - - //if (reNewStatus2.equals("待续签")) sqlwhere += " and dbo.getReNewStatus2(2,CrmContractInfo.saleContract) > 0"; - //else if (reNewStatus2.equals("已续签")) sqlwhere += " and dbo.getReNewStatus2(1,CrmContractInfo.saleContract) > 0"; - //else if (reNewStatus2.equals("无需续签")) sqlwhere += " and dbo.getReNewStatus2(3,CrmContractInfo.saleContract) > 0"; - //System.out.println("sqlwhere:"+sqlwhere); - - - if(opentype > -1){ - sqlwhere += " and isnull(CrmContractInfo.opentype,0) = " + opentype; - } - - String orderStr = " order by startDate desc, CrmContractInfo.id desc "; - -// out.println("sqlwhere:" + sqlwhere); -// out.println("orderStr:" + orderStr); - -// session.setAttribute("sqlwhere", sqlwhere); -// session.setAttribute("orderStr", orderStr); - %> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%if(HrmUserVarify.checkUserRight("ContactInfoList:ALL", user)){%> - - - <%}%> - - - - - - - - - - - - - - - - -
<%=SystemEnv.getHtmlLabelName(15774, user.getLanguage())%>
合同状态 - - <%=SystemEnv.getHtmlLabelName(1970, user.getLanguage())%> -   - <%=Util.toScreen(fromdate, user.getLanguage())%> -  -   - <%=Util.toScreen(fromdate2, user.getLanguage())%> - > - > - <%=SystemEnv.getHtmlLabelName(15236, user.getLanguage())%> -   - <%=Util.toScreen(enddate, user.getLanguage())%> -  -   - <%=Util.toScreen(enddate2, user.getLanguage())%> - > - > -
<%=SystemEnv.getHtmlLabelName(21282, user.getLanguage())%> - - PR<%=SystemEnv.getHtmlLabelName(403,user.getLanguage())%> - - JPC<%=SystemEnv.getHtmlLabelName(2171,user.getLanguage())%><%=SystemEnv.getHtmlLabelName(16992,user.getLanguage())%> - -
<%=SystemEnv.getHtmlLabelName(613002, user.getLanguage())%> - - - - - <%=SystemEnv.getHtmlLabelName(913, user.getLanguage())%> - - -
<%=SystemEnv.getHtmlLabelName(620002, user.getLanguage())%> - - - - -<%-- <%--%> -<%-- //管理员组才能查询所有部门下合同--%> -<%-- if(HrmUserVarify.checkUserRight("ContactInfo:Manager", user)){--%> -<%-- %>--%> -<%-- -<%-- id="reqDeptId"--%> -<%-- name="reqDeptId"--%> -<%-- browserValue="<%=reqDeptId %>"--%> -<%-- browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp"--%> -<%-- hasInput="true"--%> -<%-- isSingle="true"--%> -<%-- hasBrowser = "true"--%> -<%-- isMustInput='1'--%> -<%-- width="165px"--%> -<%-- browserSpanValue="<%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage())%>">--%> -<%-- --%> - -<%-- <%––%>--%> -<%-- <%}else{ %>--%> -<%-- <%=Util.toScreen(DepartmentComInfo.getDepartmentname(reqDeptId),user.getLanguage()) %>--%> -<%-- <%} %>--%> - 付款状态 - - <%=SystemEnv.getHtmlLabelName(620017, user.getLanguage())%> - -
<%=SystemEnv.getHtmlLabelName(15775, user.getLanguage())%> - - <%=SystemEnv.getHtmlLabelName(15142, user.getLanguage())%> - - <%=SystemEnv.getHtmlLabelName(141,user.getLanguage())%>: - - - "> - - - - <%-- - <%--_url="/systeminfo/BrowserMain.jsp?url=/hrm/company/SubcompanyBrowser.jsp"--%> - <%--_displayText="<%=SubCompanyComInfo.getSubCompanyname(subCompanyId+"")%>"--%> - <%-->--%> -
<%=SystemEnv.getHtmlLabelName(16404, user.getLanguage())%><%=SystemEnv.getHtmlLabelName(195, user.getLanguage())%> - - 销售合同状态 - - 开闭口类型 - -
- -
- -
- - - - -
- <% - - String tableString = ""; - String backfields = " CrmContractInfo.id,case CrmContractInfo.opentype when '0' then '闭口' when '1' then '开口' when '2' then '周期性' end opentype, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '是' else '否' end as isOverdue, conAmount, content, ',' as str_temp, case isOverdueNext when 'Y' then '是' else '否' end as isOverdueNext, case CrmContractInfo.status when '0' then '执行中' when '1' then '已结清' end as status, CrmContractInfo.creator, CrmContractInfo.subcompanyid1, case conStatus when '0' then '执行' when '1' then '待续签' when '2' then '已续签' when '3' then '关闭' end as reNewStatus, contractName, saleContract, case when dbo.getReNewStatus2(1,CrmContractInfo.saleContract) > 0 then '已续签' when dbo.getReNewStatus2(2,CrmContractInfo.saleContract) > 0 then '待续签' when dbo.getReNewStatus2(3,CrmContractInfo.saleContract) > 0 then '无需续签' end as reNewStatus2,case CrmSalesContractInfo.status when '0' then '已签署' when '1' then '未签署' when '2' then '已续签' when '3' then '关闭' end as csstatus "; - String fromSql = " CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract "; - //out.print("select"+backfields+"from"+fromSql +sqlwhere); - String str_content = "content"+"str_temp"; - tableString = " " + "" + ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - //tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - //tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += ""; - tableString += "
"; - %> - - -
-
- <%@ include file="/systeminfo/RightClickMenu_wev8.jsp"%> - - - - - - - \ No newline at end of file diff --git a/src/main/resources/ajzx/ContractReportExport.jsp b/src/main/resources/ajzx/ContractReportExport.jsp deleted file mode 100644 index 2590773..0000000 --- a/src/main/resources/ajzx/ContractReportExport.jsp +++ /dev/null @@ -1,127 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=GBK" %> -<%@ include file="/systeminfo/init.jsp" %> -<%@ page import="weaver.general.Util, weaver.file.ExcelSheet, weaver.file.ExcelRow" %> - - - - - - - - - - -<%! - public static String ToDBC(String input) { - char[] c = input.toCharArray(); - for (int i = 0; i < c.length; i++) { - if (c[i] == 12288) { - //ȫǿոΪ12288ǿոΪ32 - c[i] = (char) 32; - continue; - } - if (c[i] > 65280 && c[i] < 65375) - //ַ(33-126)ȫ(65281-65374)ĶӦϵǣ65248 - c[i] = (char) (c[i] - 65248); - } - return new String(c); - } - - -%> - -<% - // String sqlwhere=(String)session.getAttribute("sqlwhere"); -// String orderStr=(String)session.getAttribute("orderStr"); - - String sqlwhere = request.getParameter("sqlwhere"); - sqlwhere = ToDBC(sqlwhere); - String orderStr = request.getParameter("orderStr"); - orderStr = ToDBC(orderStr); - - String sqlstr = ""; - - if (RecordSet.getDBType().equals("oracle")) { - sqlstr = "select CrmContractInfo.id, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '' else '' end as isOverdue, conAmount, content, case isOverdueNext when 'Y' then '' else '' end as isOverdueNext, case CrmContractInfo.status when '0' then 'ִ' when '1' then 'ѽ' end as status, case isOneSuppliers when 'Y' then '' when 'N' then '' else '' end as isOneSuppliers, prRequestId,jpcNo,jpcFile,prNo,prAmount,prAmountSum,conAmount,managerId,subject,giveDate,giveRemark,payRemark,content,CrmContractInfo.createDate,CrmContractInfo.creator,CrmContractInfo.subcompanyid1, case conStatus when '0' then 'ִ' when '1' then 'ǩ' when '2' then 'ǩ' when '3' then 'ر' end as reNewStatus,contractName, saleContract, case CrmSalesContractInfo.status when '0' then 'ǩ' when '1' then 'δǩ' when '2' then 'ǩ' when '3' then 'ر' end as reNewStatus2 from CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract" + sqlwhere + orderStr; - } else { - sqlstr = "select CrmContractInfo.id, reqDeptId, suppliersId, conNo, name, startDate, endDate, case isOverdue when 'Y' then '' else '' end as isOverdue, conAmount, content, case isOverdueNext when 'Y' then '' else '' end as isOverdueNext, case CrmContractInfo.status when '0' then 'ִ' when '1' then 'ѽ' end as status, case isOneSuppliers when 'Y' then '' when 'N' then '' else '' end as isOneSuppliers, prRequestId,jpcNo,jpcFile,prNo,prAmount,prAmountSum,conAmount,managerId,subject,giveDate,giveRemark,payRemark,content,CrmContractInfo.createDate,CrmContractInfo.creator,CrmContractInfo.subcompanyid1, case conStatus when '0' then 'ִ' when '1' then 'ǩ' when '2' then 'ǩ' when '3' then 'ر' end as reNewStatus,contractName, saleContract, case CrmSalesContractInfo.status when '0' then 'ǩ' when '1' then 'δǩ' when '2' then 'ǩ' when '3' then 'ر' end as reNewStatus2 from CrmContractInfo Left Join CrmSalesContractInfo On CrmSalesContractInfo.id=CrmContractInfo.saleContract" + sqlwhere + orderStr; - } - new BaseBean().writeLog(">>>>>>>>"+sqlstr); - RecordSet.executeQuery(sqlstr); - - ExcelSheet es = new ExcelSheet(); - - ExcelRow er = es.newExcelRow(); - er.addStringValue(SystemEnv.getHtmlLabelName(141,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620002,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(613002,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(21282,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(15142,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(1970,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(15236,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620016,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(6146,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620015,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620017,user.getLanguage())); - er.addStringValue("״̬"); - er.addStringValue(SystemEnv.getHtmlLabelName(913,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620009,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620003,user.getLanguage())); - er.addStringValue("JPC"+SystemEnv.getHtmlLabelName(16992,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620004,user.getLanguage())); - er.addStringValue("PR"+SystemEnv.getHtmlLabelName(403,user.getLanguage())); - er.addStringValue("PR"+SystemEnv.getHtmlLabelName(856,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620010,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620011,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620006,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620012,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620013,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620014,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(620015,user.getLanguage())); - er.addStringValue(SystemEnv.getHtmlLabelName(614,user.getLanguage())+SystemEnv.getHtmlLabelName(722,user.getLanguage())); - er.addStringValue("ͬ״̬"); - er.addStringValue("ۺͬ"); - er.addStringValue("ۺͬ״̬"); - - while (RecordSet.next()) { - ExcelRow erdetail = es.newExcelRow(); - erdetail.addStringValue(SubCompanyComInfo.getSubCompanyname(RecordSet.getString("subcompanyid1"))); - erdetail.addStringValue(DepartmentComInfo.getDepartmentname(RecordSet.getString("reqDeptId"))); - erdetail.addStringValue(CrmSupplierComInfo.getSuppliername(RecordSet.getString("suppliersId"))); - erdetail.addStringValue(RecordSet.getString("conNo")); - erdetail.addStringValue(RecordSet.getString("name")); - erdetail.addStringValue(RecordSet.getString("startDate")); - erdetail.addStringValue(RecordSet.getString("endDate")); - erdetail.addStringValue(RecordSet.getString("isOverdue")); - erdetail.addStringValue(RecordSet.getString("conAmount")); - erdetail.addStringValue(Util.toScreen(SptmForDoc.getDocName(RecordSet.getString("content")), user.getLanguage())); - erdetail.addStringValue(RecordSet.getString("isOverdueNext")); - erdetail.addStringValue(RecordSet.getString("status")); - erdetail.addStringValue(Util.toScreen(ResourceComInfo.getResourcename(RecordSet.getString("creator")), user.getLanguage())); - erdetail.addStringValue(RecordSet.getString("isOneSuppliers")); - erdetail.addStringValue(RequestComInfo.getRequestname(RecordSet.getString("prRequestId"))); - erdetail.addStringValue(RecordSet.getString("jpcNo")); - erdetail.addStringValue(DocComInfo.getDocname(RecordSet.getString("jpcFile"))); - erdetail.addStringValue(RecordSet.getString("prNo")); - erdetail.addStringValue(RecordSet.getString("prAmount")); - erdetail.addStringValue(RecordSet.getString("prAmountSum")); - erdetail.addStringValue(ResourceComInfo.getResourcename(RecordSet.getString("managerId"))); - erdetail.addStringValue(RecordSet.getString("subject")); - erdetail.addStringValue(RecordSet.getString("giveDate")); - erdetail.addStringValue(RecordSet.getString("giveRemark")); - erdetail.addStringValue(RecordSet.getString("payRemark")); - erdetail.addStringValue(DocComInfo.getDocname(RecordSet.getString("content"))); - erdetail.addStringValue(RecordSet.getString("createDate")); - erdetail.addStringValue(RecordSet.getString("reNewStatus")); - erdetail.addStringValue(RecordSet.getString("contractName")); - erdetail.addStringValue(RecordSet.getString("reNewStatus2")); - } - - ExcelFile.init(); - ExcelFile.setFilename("ͬ"); - ExcelFile.addSheet("ͬ", es); -%> - -<%----%> \ No newline at end of file diff --git a/src/test/java/bokang/xiao/NormalTest.java b/src/test/java/bokang/xiao/NormalTest.java index 7b03a1d..7227bb1 100644 --- a/src/test/java/bokang/xiao/NormalTest.java +++ b/src/test/java/bokang/xiao/NormalTest.java @@ -305,7 +305,7 @@ public class NormalTest extends BaseTest { queryParam.put("fieldValue","mqErrorLogModelId"); ModeMapper mapper = Util.getMapper(ModeMapper.class); Map modeData = mapper.queryModeDataInfo("uf_systemconfig", queryParam); - modeChangeService.changeOtherMode(modeData,"-18"); + modeChangeService.changeOtherMode(modeData,"-18",1); } @Test @@ -341,4 +341,11 @@ public class NormalTest extends BaseTest { String s = customSearchDepart.generateSqlCondition(param); } + @Test + public void testSub(){ + String sourceStr = ",0,1,2,"; + String value = ",0,"; + System.out.println(sourceStr.contains(value)); + } + }