From e0fbba9ebdd89f182f4759c16d9e92f7c2cc1690 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Mon, 22 Jul 2024 14:18:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=A0=BC=E9=A2=84=E5=AE=A1=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ABAP_AS_WITH_POOL.jcoDestination | 4 +- .../web/controller/bid/BidController.java | 30 +- .../system/SysChangeRecordController.java | 37 ++ .../web/controller/zgys/ZgysController.java | 117 ++++ .../changeRecord/ChangeRecordAspect.java | 198 +++++++ .../changeRecord/ChangeRecordLog.java | 34 ++ .../framework/changeRecord/ContentParser.java | 17 + .../framework/changeRecord/DataName.java | 15 + .../changeRecord/DefaultContentParse.java | 39 ++ .../changeRecord/ReflectionUtils.java | 138 +++++ .../changeRecord/SpringBootBeanUtil.java | 61 ++ .../main/java/com/ruoyi/bid/domain/Bid.java | 49 ++ .../ruoyi/system/domain/SysChangeRecord.java | 27 +- .../system/mapper/SysChangeRecordMapper.java | 9 +- .../main/java/com/ruoyi/zgys/domain/Zgys.java | 301 ++++++++++ .../com/ruoyi/zgys/mapper/ZgysMapper.java | 68 +++ .../com/ruoyi/zgys/service/IZgysService.java | 68 +++ .../zgys/service/impl/ZgysServiceImpl.java | 110 ++++ .../mapper/system/SysChangeRecordMapper.xml | 12 +- .../main/resources/mapper/zgys/ZgysMapper.xml | 183 ++++++ ruoyi-ui/src/api/system/changeRecord.js | 11 + ruoyi-ui/src/api/zgys/zgys.js | 44 ++ ruoyi-ui/src/views/bid/bid/index.vue | 144 ++++- .../components/Tools/ChangeRecord/index.vue | 93 +++ ruoyi-ui/src/views/quot/quot/index.vue | 2 +- ruoyi-ui/src/views/redBook/productSelect.vue | 8 +- ruoyi-ui/src/views/redBook/quots.vue | 6 +- ruoyi-ui/src/views/zgys/zgys/index.vue | 551 ++++++++++++++++++ 28 files changed, 2330 insertions(+), 46 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysChangeRecordController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/zgys/ZgysController.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ChangeRecordAspect.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ChangeRecordLog.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ContentParser.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/DataName.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/DefaultContentParse.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ReflectionUtils.java create mode 100644 ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/SpringBootBeanUtil.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/zgys/domain/Zgys.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/zgys/mapper/ZgysMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/zgys/service/IZgysService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/zgys/service/impl/ZgysServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/zgys/ZgysMapper.xml create mode 100644 ruoyi-ui/src/api/system/changeRecord.js create mode 100644 ruoyi-ui/src/api/zgys/zgys.js create mode 100644 ruoyi-ui/src/views/components/Tools/ChangeRecord/index.vue create mode 100644 ruoyi-ui/src/views/zgys/zgys/index.vue diff --git a/ABAP_AS_WITH_POOL.jcoDestination b/ABAP_AS_WITH_POOL.jcoDestination index 184244c..dc24600 100644 --- a/ABAP_AS_WITH_POOL.jcoDestination +++ b/ABAP_AS_WITH_POOL.jcoDestination @@ -1,5 +1,5 @@ #for tests only ! -#Tue Jul 16 09:48:52 CST 2024 +#Mon Jul 22 13:35:56 CST 2024 jco.destination.pool_capacity=10 jco.client.lang=ZH jco.client.ashost=172.19.0.125 @@ -7,5 +7,5 @@ jco.client.saprouter= jco.client.user=RFC jco.client.sysnr=00 jco.destination.peak_limit=10 -jco.client.passwd=fIIvwvEBHbcBvFB_tS(Vu[3tV[6as:m0)kkAT/TIkq(z)5~9 +jco.client.passwd=d5-l}25LC/syTMZBj},zzcOyD{}`D$_}M#F{]EU?5=[as!f` jco.client.client=800 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BidController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BidController.java index a5ca080..9fbeedf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BidController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BidController.java @@ -15,6 +15,7 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.MinioUtil; import com.ruoyi.common.utils.uuid.UUID; +import com.ruoyi.framework.changeRecord.ChangeRecordLog; import com.ruoyi.quot.domain.Quot; import com.ruoyi.redBook.domain.OAQuot; import com.ruoyi.redBook.domain.RbVersionDateResult; @@ -66,6 +67,9 @@ public class BidController extends BaseController * 分派 */ @PreAuthorize("@ss.hasPermi('bid:bid:assign')") + @ChangeRecordLog(serviceImplclass = "com.ruoyi.bid.service.impl.BidServiceImpl", + serviceImplMethod="selectBidByBidId", + tableId = "bidId",codeName = "bidCode") @Log(title = "分派投标信息", businessType = BusinessType.EXPORT) @PostMapping("/bidAssign") public AjaxResult bidAssign(@RequestBody Bid bid) @@ -110,7 +114,7 @@ public class BidController extends BaseController * 导出投标信息列表 */ @PreAuthorize("@ss.hasPermi('bid:bid:export')") - @Log(title = "投标信息", businessType = BusinessType.EXPORT) + @Log(title = "投标信息导出", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, Bid bid) { @@ -133,7 +137,7 @@ public class BidController extends BaseController * 新增投标信息 */ @PreAuthorize("@ss.hasPermi('bid:bid:add')") - @Log(title = "投标信息", businessType = BusinessType.INSERT) + @Log(title = "投标信息新增", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Bid bid) { @@ -150,7 +154,10 @@ public class BidController extends BaseController * 修改投标信息 */ @PreAuthorize("@ss.hasPermi('bid:bid:edit')") - @Log(title = "投标信息", businessType = BusinessType.UPDATE) + @ChangeRecordLog(serviceImplclass = "com.ruoyi.bid.service.impl.BidServiceImpl", + serviceImplMethod="selectBidByBidId", + tableId = "bidId",codeName = "bidCode") + @Log(title = "投标信息修改", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Bid bid) { @@ -167,7 +174,7 @@ public class BidController extends BaseController * @throws Exception */ @PreAuthorize("@ss.hasAnyPermi('bid:bid:bidYwyFile,bid:bid:bidTbbFile')") - @Log(title = "上传报价附件", businessType = BusinessType.INSERT) + @Log(title = "上传投标附件", businessType = BusinessType.INSERT) @PostMapping("/bidFile") public AjaxResult bidFile(@RequestParam("bidFile") MultipartFile file, @RequestParam("relation_id") String relation_id, @RequestParam("file_type") String file_type) throws Exception { @@ -194,7 +201,7 @@ public class BidController extends BaseController bidFileService.insertBidFile(bidFile); } }else{ - return error("系统异常,报价单号为空!"); + return error("系统异常,投标单号为空!"); } return success("上传成功!"); } @@ -234,6 +241,9 @@ public class BidController extends BaseController * 提交OA事业部经理、店长/投标办按钮 */ @PreAuthorize("@ss.hasPermi('bid:bid:commit')") + @ChangeRecordLog(serviceImplclass = "com.ruoyi.bid.service.impl.BidServiceImpl", + serviceImplMethod="selectBidByBidId", + tableId = "bidId",codeName = "bidCode") @Log(title = "提交投标办", businessType = BusinessType.OTHER) @PostMapping("/commitTbxx") public AjaxResult commitTbxx(@RequestBody Bid bid) @@ -345,6 +355,9 @@ public class BidController extends BaseController * 投标提交技术协助 */ @PreAuthorize("@ss.hasPermi('bid:bid:assist')") + @ChangeRecordLog(serviceImplclass = "com.ruoyi.bid.service.impl.BidServiceImpl", + serviceImplMethod="selectBidByBidId", + tableId = "bidId",codeName = "bidCode") @Log(title = "投标提交技术协助", businessType = BusinessType.OTHER) @PostMapping("/commitJsBid") public AjaxResult commitJsBid(@RequestBody Bid bid) @@ -394,10 +407,10 @@ public class BidController extends BaseController bidJsqr.setCreateBy(getUsername()); bidJsqr.setUpdateBy(getUsername()); - bidJsqrService.insertBidJsqr(bidJsqr);//生成报价单-技术确认单 + bidJsqrService.insertBidJsqr(bidJsqr);//生成投标单-技术确认单 bid.setBidJsxzConfirmId(bidJsqrId); - bid.setBidJsxzApprovalStatus("1");//报价单-技术确认单 状态设置为 协助中 + bid.setBidJsxzApprovalStatus("1");//投标单-技术确认单 状态设置为 协助中 bidService.updateBid(bid); //sendNoticeToJsxz(bidJsqr); @@ -409,6 +422,9 @@ public class BidController extends BaseController * 投标驳回 */ @PreAuthorize("@ss.hasPermi('bid:bid:reject')") + @ChangeRecordLog(serviceImplclass = "com.ruoyi.bid.service.impl.BidServiceImpl", + serviceImplMethod="selectBidByBidId", + tableId = "bidId",codeName = "bidCode") @Log(title = "投标驳回", businessType = BusinessType.OTHER) @PostMapping("/rejectBid") public AjaxResult rejectBid(@RequestBody Bid bid) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysChangeRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysChangeRecordController.java new file mode 100644 index 0000000..8ddbf05 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysChangeRecordController.java @@ -0,0 +1,37 @@ +package com.ruoyi.web.controller.system; + +import com.ruoyi.system.domain.SysChangeRecord; +import com.ruoyi.system.domain.SysNoticeUser; +import com.ruoyi.system.mapper.SysChangeRecordMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 业务单据变更记录 + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/changeRecord") +public class SysChangeRecordController { + + @Autowired + private SysChangeRecordMapper changeRecordMapper; + + /** + * 导航面板 消息通知-更多 + * @return + */ + @GetMapping("/recordsList") + public List recordsList(SysChangeRecord sysChangeRecord) + { + List list = changeRecordMapper.recordsList(sysChangeRecord); + list.sort((t1, t2) -> t2.getChangeTime().compareTo(t1.getChangeTime())); + return list; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zgys/ZgysController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zgys/ZgysController.java new file mode 100644 index 0000000..6ccdcef --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/zgys/ZgysController.java @@ -0,0 +1,117 @@ +package com.ruoyi.web.controller.zgys; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.utils.uuid.UUID; +import com.ruoyi.framework.changeRecord.ChangeRecordLog; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.zgys.domain.Zgys; +import com.ruoyi.zgys.service.IZgysService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 资格预审Controller + * + * @author ruoyi + * @date 2024-07-22 + */ +@RestController +@RequestMapping("/zgys/zgys") +public class ZgysController extends BaseController +{ + @Autowired + private IZgysService zgysService; + + /** + * 查询资格预审列表 + */ + @PreAuthorize("@ss.hasPermi('zgys:zgys:list')") + @GetMapping("/list") + public TableDataInfo list(Zgys zgys) + { + startPage(); + List list = zgysService.selectZgysList(zgys); + return getDataTable(list); + } + + /** + * 导出资格预审列表 + */ + @PreAuthorize("@ss.hasPermi('zgys:zgys:export')") + @Log(title = "资格预审导出", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Zgys zgys) + { + List list = zgysService.selectZgysList(zgys); + ExcelUtil util = new ExcelUtil(Zgys.class); + util.exportExcel(response, list, "资格预审数据"); + } + + /** + * 获取资格预审详细信息 + */ + @PreAuthorize("@ss.hasPermi('zgys:zgys:query')") + @GetMapping(value = "/{pqId}") + public AjaxResult getInfo(@PathVariable("pqId") String pqId) + { + return success(zgysService.selectZgysByPqId(pqId)); + } + + /** + * 新增资格预审 + */ + @PreAuthorize("@ss.hasPermi('zgys:zgys:add')") + @Log(title = "资格预审新增", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Zgys zgys) + { + zgys.setPqId(UUID.fastUUID().toString()); + String bidCode = zgysService.getCode("TBXX"); + zgys.setPqCode(bidCode); + zgys.setCreateBy(getUsername()); + zgys.setUpdateBy(getUsername()); + zgysService.insertZgys(zgys); + return success(zgys); + } + + /** + * 修改资格预审 + */ + @PreAuthorize("@ss.hasPermi('zgys:zgys:edit')") + @ChangeRecordLog(serviceImplclass = "com.ruoyi.zgys.service.impl.ZgysServiceImpl", + serviceImplMethod="selectZgysByPqId", + tableId = "pqId",codeName = "pqCode") + @Log(title = "资格预审修改", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Zgys zgys) + { + zgys.setUpdateBy(getUsername()); + return toAjax(zgysService.updateZgys(zgys)); + } + + /** + * 删除资格预审 + */ + @PreAuthorize("@ss.hasPermi('zgys:zgys:remove')") + @Log(title = "资格预审删除", businessType = BusinessType.DELETE) + @DeleteMapping("/{pqIds}") + public AjaxResult remove(@PathVariable String[] pqIds) + { + return toAjax(zgysService.deleteZgysByPqIds(pqIds)); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ChangeRecordAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ChangeRecordAspect.java new file mode 100644 index 0000000..bb7063b --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ChangeRecordAspect.java @@ -0,0 +1,198 @@ +package com.ruoyi.framework.changeRecord; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.ruoyi.common.annotation.DataName; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.SysChangeRecord; +import com.ruoyi.system.mapper.SysChangeRecordMapper; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.*; + +@Aspect +@Component +@Slf4j +@SuppressWarnings("all") +public class ChangeRecordAspect { + + @Autowired + private SysChangeRecordMapper changeRecordMapper; + + @Autowired + private ApplicationContext applicationContext; + + //保存修改之前的数据 + Map oldMap = new HashMap<>(); + + /** + * 处理请求前执行 + */ + @Before(value = "@annotation(operateLog)") + public void boBefore(JoinPoint joinPoint, ChangeRecordLog operateLog) throws Exception { + ContentParser contentParser = (ContentParser) applicationContext.getBean(operateLog.parseclass()); + //旧值 + Object oldObject = contentParser.getResult(joinPoint, operateLog, operateLog.tableId()); + if (operateLog.needDefaultCompare()) { + oldMap = (Map) objectToMap(oldObject); // 存储修改前的对象 + } + } + + + /** + * 处理请求后执行 + * @param joinPoint + * @param operateLog + * @throws Throwable + */ + @After("@annotation(operateLog)") + public void around(JoinPoint joinPoint, ChangeRecordLog operateLog) throws Throwable { + try { + SysChangeRecord changeRecord = new SysChangeRecord(); + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest request = attributes.getRequest(); + // 从切面织入点处通过反射机制获取织入点处的方法 + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); // 获取切入点所在的方法 + String meName = method.getName(); // 获取请求的方法名 + String className = joinPoint.getTarget().getClass().getName(); // 获取请求的类名 + String methodName = className + "." + meName; + String uri = request.getRequestURL().toString(); // 请求uri + Object[] args = joinPoint.getArgs(); + // 请求参数 预留 + //String requestParams = JSON.toJSONString(args); + //创建人信息 + changeRecord.setChangeTime(DateUtils.getTime()); + changeRecord.setCreateName(SecurityUtils.getLoginUser().getUser().getUserName()); + Object object = null; + ContentParser contentParser; + try { + contentParser = (ContentParser) applicationContext.getBean(operateLog.parseclass()); + object = contentParser.getResult(joinPoint, operateLog, operateLog.tableId()); + } catch (Exception e) { + e.printStackTrace(); + log.error("service加载失败:", e); + } + if ("add".equals(operateLog.type())) { + Map dataMap = (Map) objectToMap(object); + log.info("新增的数据:{}" + dataMap.toString()); + } + if (operateLog.needDefaultCompare()) { + //比较新数据与数据库原数据 + List> list = defaultDealUpdate(object, oldMap, operateLog.tableId(),operateLog.codeName()); + for (Map dataMap : list) { + changeRecord.setChangeField(String.valueOf(dataMap.get("filedName"))); + changeRecord.setBeforeChange(String.valueOf(dataMap.get("oldValue"))); + changeRecord.setAfterChange(String.valueOf(dataMap.get("newValue"))); + changeRecord.setTypeId(String.valueOf(dataMap.get(operateLog.tableId()))); + changeRecord.setCodeName(String.valueOf(dataMap.get(operateLog.codeName()))); + changeRecordMapper.insertChangeRecord(changeRecord); + } + } + } catch (Exception e) { + log.info("自定义变更记录注解出现异常"); + e.printStackTrace(); + } + + } + + private List> defaultDealUpdate(Object newObject, Map oldMap, String tableId, String codeName) { + try { + List> list = new ArrayList<>(); + Map newMap = (Map) objectToMap(newObject); + Object finalNewObject = newObject; + oldMap.forEach((k, v) -> { + Object newResult = newMap.get(k); + if (null != v && !v.equals(newResult)) { + Field field = ReflectionUtils.getAccessibleField(finalNewObject, k); + DataName dataName = field.getAnnotation(DataName.class); + if (null != dataName && StringUtils.isNotEmpty(dataName.name())) { + //翻译表达式 0=男,1=女 + String readConverterExp = dataName.readConverterExp(); + Map result = new HashMap(); + result.put("filedName", dataName.name()); + result.put(tableId, newMap.get(tableId)); + result.put(codeName, newMap.get(codeName)); + if (StringUtils.isNotEmpty(dataName.readConverterExp())) { + String oldValue = convertByExp( + String.valueOf(v), dataName.readConverterExp(), ","); + String newValue = convertByExp( + String.valueOf(newResult), dataName.readConverterExp(), ","); + result.put("oldValue", oldValue); + result.put("newValue", newValue); + } else { + result.put("oldValue", v); + result.put("newValue", newResult); + } + list.add(result); + } + } + }); + log.info("比较的数据哈:{}" + list.toString()); + return list; + } catch (Exception e) { + log.error("比较异常", e); + e.printStackTrace(); + throw new RuntimeException("比较异常", e); + } + } + + private Map objectToMap(Object obj) { + if (obj == null) { + return null; + } + ObjectMapper mapper = new ObjectMapper(); + mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + // 如果使用JPA请自己打开这条配置 + // mapper.addMixIn(Object.class, IgnoreHibernatePropertiesInJackson.class); + Map mappedObject = mapper.convertValue(obj, Map.class); + return mappedObject; + } + + /** + * 翻译 + * + * @param propertyValue 参数值如:0 + * @param converterExp 翻译注解的值如:0=男,1=女,2=未知 + * @param separator 分隔符 + * @return 解析后值 + */ + public static String convertByExp(String propertyValue, String converterExp, String separator) { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(","); + for (String item : convertSource) { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(propertyValue, separator)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[0].equals(value)) { + propertyString.append(itemArray[1] + separator); + break; + } + } + } else { + if (itemArray[0].equals(propertyValue)) { + return itemArray[1]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ChangeRecordLog.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ChangeRecordLog.java new file mode 100644 index 0000000..5bde3ee --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ChangeRecordLog.java @@ -0,0 +1,34 @@ +package com.ruoyi.framework.changeRecord; + +import java.lang.annotation.*; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD}) +public @interface ChangeRecordLog { + + // 获取编辑信息的解析类,目前为使用id获取 + Class parseclass() default DefaultContentParse.class; + + // 实现类 + String serviceImplclass() default ""; + + // 实现类方法名 + String serviceImplMethod() default ""; + + // 是否需要比较新旧数据 + boolean needDefaultCompare() default true; + + // id的类型 + Class idType() default String.class; + + // 操作对象的id字段名称 + String tableId() default "id"; + + // 单号字段名称 + String codeName() default ""; + + //操作类型 + String type() default "update"; + +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ContentParser.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ContentParser.java new file mode 100644 index 0000000..168046d --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ContentParser.java @@ -0,0 +1,17 @@ +package com.ruoyi.framework.changeRecord; + +import org.aspectj.lang.JoinPoint; + +public interface ContentParser { + + /** + * 获取信息返回查询出的对象 + * + * @param joinPoint 查询条件的参数 + * @param operateLog 注解 + * @return 获得的结果 + */ + public Object getResult(JoinPoint joinPoint, ChangeRecordLog operateLog, String tableId) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, Exception; + + +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/DataName.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/DataName.java new file mode 100644 index 0000000..b22ded7 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/DataName.java @@ -0,0 +1,15 @@ +package com.ruoyi.framework.changeRecord; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD}) +@Documented +public @interface DataName { + String name() default ""; // 字段名称 + + /** + * 读取枚举内容转义表达式 (如: 0=男,1=女,2=未知) + */ + String readConverterExp() default ""; +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/DefaultContentParse.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/DefaultContentParse.java new file mode 100644 index 0000000..669b710 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/DefaultContentParse.java @@ -0,0 +1,39 @@ +package com.ruoyi.framework.changeRecord; + +import org.aspectj.lang.JoinPoint; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; +import java.lang.reflect.Method; + +@Component +public class DefaultContentParse implements ContentParser { + + @Autowired + private ApplicationContext applicationContext; + + @Override + public Object getResult(JoinPoint joinPoint, ChangeRecordLog operateLog, String tableId) throws Exception { + Object info = joinPoint.getArgs()[0]; + Object id = ReflectionUtils.getFieldValue(info, tableId); + Assert.notNull(id, "id不能为空"); + String serviceImplName = operateLog.serviceImplclass(); + String serviceImplMethod = operateLog.serviceImplMethod(); + + Class idType = operateLog.idType(); + if (idType.isInstance(id)) { + //从ApplicationContext中取出已创建好的的对象 + //不可直接反射创建serviceimpi对象,因为反射创建出来的对象无法实例化dao接口 + ApplicationContext applicationContext = SpringBootBeanUtil.getApplicationContext(); + //反射创建serviceimpi实体对象,和实体类 + Class ServiceImplType = Class.forName(serviceImplName); + Method method = ServiceImplType.getDeclaredMethod(serviceImplMethod,String.class); + + // 使用反射调用方法 + return method.invoke(applicationContext.getBean(ServiceImplType),id); + } else { + throw new RuntimeException("请核实id type"); + } + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ReflectionUtils.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ReflectionUtils.java new file mode 100644 index 0000000..215c3f3 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/ReflectionUtils.java @@ -0,0 +1,138 @@ +package com.ruoyi.framework.changeRecord; + +import lombok.extern.slf4j.Slf4j; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Slf4j +public class ReflectionUtils { + + /** + * 直接读取对象属性值, 无视private/protected修饰符, 不经过getter函数. + * @param obj 读取的对象 + * @param fieldName 读取的列 + * @return 属性值 + */ + public static Object getFieldValue(final Object obj, final String fieldName) { + Field field = getAccessibleField(obj, fieldName); + if (field == null) { + throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + obj + "]"); + } + + Object result = null; + try { + result = field.get(obj); + } catch (IllegalAccessException e) { + log.error("不可能抛出的异常{}", e.getMessage()); + e.printStackTrace(); + } + return result; + } + + /** + * 循环向上转型, 获取对象的DeclaredField, 并强制设置为可访问.如向上转型到Object仍无法找到, 返回null. + * @param obj 查找的对象 + * @param fieldName 列名 + * @return 列 + */ + public static Field getAccessibleField(final Object obj, final String fieldName) { + for (Class superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) { + try { + Field field = superClass.getDeclaredField(fieldName); + makeAccessible(field); + return field; + } catch (NoSuchFieldException e) { // NOSONAR + // Field不在当前类定义,继续向上转型 + continue; // new add + } + } + return null; + } + + /** + * 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。 + * @param + */ + public static void makeAccessible(Field field) { + if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) || Modifier + .isFinal(field.getModifiers())) && !field.isAccessible()) { + field.setAccessible(true); + } + } + + /** + * 获取两个对象同名属性内容不相同的列表 + * @param class1 old对象 + * @param class2 new对象 + * @return 区别列表 + * @throws ClassNotFoundException 异常 + * @throws IllegalAccessException 异常 + */ + public static List> compareTwoClass(Object class1, Object class2) throws ClassNotFoundException, IllegalAccessException { + List> list=new ArrayList>(); + // 获取对象的class + Class clazz1 = class1.getClass(); + Class clazz2 = class2.getClass(); + // 获取对象的属性列表 + Field[] field1 = clazz1.getDeclaredFields(); + Field[] field2 = clazz2.getDeclaredFields(); + StringBuilder sb=new StringBuilder(); + // 遍历属性列表field1 + for(int i=0;i map2 = new HashMap(); + DataName name=field1[i].getAnnotation(DataName.class); + String fieldName=""; + if(name!=null){ + fieldName=name.name(); + } else { + fieldName=field1[i].getName(); + } + map2.put("name", fieldName); + map2.put("old", field1[i].get(class1)); + map2.put("new", field2[j].get(class2)); + list.add(map2); + } + break; + } + } + } + } + return list; + } + + /** + * 对比两个数据是否内容相同 + * @param object1 比较对象1 + * @param object2 比较对象2 + * @return boolean类型 + */ + public static boolean compareTwo(Object object1,Object object2){ + if(object1==null&&object2==null){ + return true; + } + if(object1==null&&object2!=null){ + return false; + } + if(object1.equals(object2)){ + return true; + } + return false; + } + + + +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/SpringBootBeanUtil.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/SpringBootBeanUtil.java new file mode 100644 index 0000000..c442b25 --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/changeRecord/SpringBootBeanUtil.java @@ -0,0 +1,61 @@ +package com.ruoyi.framework.changeRecord; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * SpringBoot 普通类获取Spring容器中的bean工具类 + */ +@Component +public class SpringBootBeanUtil implements ApplicationContextAware { + + private static ApplicationContext applicationContext; + + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + if (SpringBootBeanUtil.applicationContext == null) { + SpringBootBeanUtil.applicationContext = applicationContext; + } + System.out.println("========ApplicationContext配置成功========"); +// System.out.println("========在普通类可以通过调用SpringBootBeanUtil.getApplicationContext()获取applicationContext对象========"); + System.out.println("========applicationContext="+ SpringBootBeanUtil.applicationContext +"========"); + } + + /** + * 获取applicationContext + * @return + */ + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + /** + * 通过name获取 Bean. + * @param name + * @return + */ + public static Object getBean(String name) { + return getApplicationContext().getBean(name); + } + + /** + * 通过class获取Bean. + * @param clazz + * @return + */ + public static T getBean(Class clazz) { + return getApplicationContext().getBean(clazz); + } + + /** + * 通过name,以及Clazz返回指定的Bean + * @param name + * @param clazz + * @return + */ + public static T getBean(String name, Class clazz) { + return getApplicationContext().getBean(name, clazz); + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/bid/domain/Bid.java b/ruoyi-system/src/main/java/com/ruoyi/bid/domain/Bid.java index 9eca19f..8352da8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bid/domain/Bid.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bid/domain/Bid.java @@ -1,5 +1,6 @@ package com.ruoyi.bid.domain; +import com.ruoyi.common.annotation.DataName; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -42,21 +43,26 @@ public class Bid extends BaseEntity private String bidSalesmanDeptName; /** 是否报名 */ + @DataName(name = "是否报名") private String bidHasRegistration; /** 原报名编号 */ @Excel(name = "原报名编号") + @DataName(name = "原报名编号") private String bidRegistrationNumber; /** 开标日期 */ @Excel(name = "开标日期") + @DataName(name = "开标日期") private String bidOpeningDate; /** 是否网上报价(0-是/1-否) */ @Excel(name = "是否网上报价",dictType = "bid_online_quotation") + @DataName(name = "是否网上报价",readConverterExp="0=是,1=否") private String bidOnlineQuotation; /** 报价平台网址 */ + @DataName(name = "报价平台网址") private String bidWebsite; /** 招标单位编码 */ @@ -64,140 +70,183 @@ public class Bid extends BaseEntity /** 招标单位 */ @Excel(name = "招标单位") + @DataName(name = "招标单位") private String bidTenderingUnit; /** 招标代理 */ @Excel(name = "招标代理") + @DataName(name = "招标代理") private String bidAgency; /** 项目名称 */ @Excel(name = "项目名称") + @DataName(name = "项目名称") private String bidProject; /** 授权代表 */ @Excel(name = "授权代表") + @DataName(name = "授权代表") private String bidAuthorizedRepresentative; /** 授权人联系方式 */ + @DataName(name = "联系方式") private String bidAuthorizedPhone; /** 招标文件付款方式 */ + @DataName(name = "招标文件付款方式") private String bidFilePaymentMethod; /** 投标付款偏差 */ + @DataName(name = "投标付款偏差") private String bidPaymentDeviation; /** 是否铜价联动(0-是/1-否) */ + @DataName(name = "是否铜价联动",readConverterExp="0=是,1=否") private String bidCopperPriceLinkage; /** 价格联动方式 */ + @DataName(name = "价格联动方式") private String bidPriceLinkageMethod; /** 其他投标要求 */ + @DataName(name = "其他投标要求") private String bidOtherRequire; /** 中标金额 */ + @DataName(name = "中标金额") private String bidWinningAmount; /** 铜电缆金额 */ + @DataName(name = "铜电缆金额") private String bidCopperCableAmount; /** 铝电缆金额 */ + @DataName(name = "铝电缆金额") private String bidAluminumCableAmount; /** 开闭口(1-开口价/2-闭口价) */ + @DataName(name = "开闭口",readConverterExp="1=开口价,2=闭口价") private String bidOpenClose; /** 调价通知 */ + @DataName(name = "调价通知") private String bidPriceAdjustmentNotice; /** 投标有效期 */ + @DataName(name = "投标有效期") private String bidValidityPeriod; /** 铜价 */ + @DataName(name = "铜价") private String bidTongPrice; /** 铝价 */ + @DataName(name = "铝价") private String bidLvPrice; /** 点数 */ + @DataName(name = "点数") private String bidDs; /** 厂价 */ + @DataName(name = "厂价") private String bidFactoryPrice; /** 投标价 */ + @DataName(name = "投标价") private String bidPrice; /** 业务费结算 */ + @DataName(name = "业务费结算") private String bidBusinessSettlement; /** 保证金 */ + @DataName(name = "保证金") private String bidBond; /** 中标服务费 */ + @DataName(name = "中标服务费") private String bidWinningServiceFee; /** 履约保证金 */ + @DataName(name = "履约保证金") private String bidPerformanceBond; /** 交货期(工期) */ + @DataName(name = "交货期") private String bidDeliveryDate; /** 质保期 */ + @DataName(name = "质保期") private String bidWarrantyPeriod; /** 是否竞价(0-是/1-否) */ + @DataName(name = "是否竞价",readConverterExp="0=是,1=否") private String bidBidding; /** 评标办法 */ + @DataName(name = "评标办法") private String bidEvaluationMethod; /** 技术要求 */ + @DataName(name = "技术要求") private String bidTechnicalRequire; /** 价格联动 */ + @DataName(name = "价格联动") private String bidPriceLinkage; /** 付款方式 */ + @DataName(name = "付款方式") private String bidPaymentMethod; /** 其余事项 */ + @DataName(name = "其余事项") private String bidOtherMatters; /** 制标人 */ @Excel(name = "制标人") + @DataName(name = "制标人") private String bidZbr; /** 校对人 */ @Excel(name = "校对人") + @DataName(name = "校对人") private String bidJdr; /** 审核人 */ @Excel(name = "审核人") + @DataName(name = "审核人") private String bidShr; /** 提交状态 */ @Excel(name = "提交状态",dictType = "bid_approval_status") + @DataName(name = "提交状态",readConverterExp="0=待提交,1=协助中,2=已完成,3=已驳回,4=审批中") private String bidApprovalStatus; /** 有无中标通知书(0-是/1-否) */ + @DataName(name = "有无中标通知书",readConverterExp="0=是,1=否") private String bidNotificationAward; /** 备注 */ + @DataName(name = "备注") private String bidRemark; /** 驳回原因 */ + @DataName(name = "反馈说明") private String bidReturnRemark; /** 创建人 */ private String createName; /** 分派情况 0-已分派/1-未分派 */ + @DataName(name = "分派情况",readConverterExp="0=已分派,1=未分派") private String setReceiveUser; /** 分派接收人 */ + @DataName(name = "分派接收人账号") private String receiveUserName; + @DataName(name = "分派接收人姓名") private String receiveUserNickName; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysChangeRecord.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysChangeRecord.java index 5a2d373..b2e3130 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysChangeRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysChangeRecord.java @@ -1,30 +1,19 @@ package com.ruoyi.system.domain; -import com.fasterxml.jackson.annotation.JsonFormat; - -import java.util.Date; - public class SysChangeRecord { - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date changeTime; - + private String changeTime; private String createName; - private String changeField; - private String beforeChange; - private String afterChange; - private String typeId; + private String codeName; - private String remark; - - public Date getChangeTime() { + public String getChangeTime() { return changeTime; } - public void setChangeTime(Date changeTime) { + public void setChangeTime(String changeTime) { this.changeTime = changeTime; } @@ -68,11 +57,7 @@ public class SysChangeRecord { this.typeId = typeId; } - public String getRemark() { - return remark; - } + public String getCodeName() { return codeName; } - public void setRemark(String remark) { - this.remark = remark; - } + public void setCodeName(String codeName) { this.codeName = codeName; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysChangeRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysChangeRecordMapper.java index 81f7d3e..9c6aa21 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysChangeRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysChangeRecordMapper.java @@ -1,7 +1,8 @@ package com.ruoyi.system.mapper; - import com.ruoyi.system.domain.SysChangeRecord; +import java.util.List; + /** * 变更日志记录Mapper */ @@ -11,4 +12,10 @@ public interface SysChangeRecordMapper { * @param changeRecord */ public void insertChangeRecord(SysChangeRecord changeRecord); + + /** + * 获取变更记录 + * @return + */ + List recordsList(SysChangeRecord sysChangeRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/zgys/domain/Zgys.java b/ruoyi-system/src/main/java/com/ruoyi/zgys/domain/Zgys.java new file mode 100644 index 0000000..4cecbf5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/zgys/domain/Zgys.java @@ -0,0 +1,301 @@ +package com.ruoyi.zgys.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 资格预审对象 zgys + * + * @author ruoyi + * @date 2024-07-22 + */ +public class Zgys extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private String pqId; + + /** 资格预审单编号 */ + @Excel(name = "资格预审单编号") + private String pqCode; + + /** 业务员账号 */ + private String pqSalesmanCode; + + /** 业务员编码 */ + private String pqSalesmanBm; + + /** 业务员 */ + @Excel(name = "业务员") + private String pqSalesmanName; + + /** 部门id */ + private String pqSalesmanDeptId; + + /** 部门名 */ + @Excel(name = "部门名") + private String pqSalesmanDeptName; + + /** 客户编码 */ + private String pqCustomerBm; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String pqCustomerName; + + /** 项目 */ + @Excel(name = "项目") + private String pqProject; + + /** 中标备注 */ + private String pqBidWinningRemark; + + /** 授权人 */ + @Excel(name = "授权人") + private String pqAuthorizedRepresentative; + + /** 投标日期 */ + @Excel(name = "投标日期") + private String pqBidDate; + + /** 制标人 */ + @Excel(name = "制标人") + private String pqZbr; + + /** 中标状态 */ + @Excel(name = "中标状态") + private String pqBidWinningStatus; + + /** 说明 */ + private String pqIllustrate; + + /** 公告链接网址 */ + private String pqAnnouncementLinkWebsite; + + /** 联系电话 */ + private String pqPhone; + + /** 招标代理 */ + private String pqAgency; + + /** 备注 */ + private String pqRemark; + + /** 是否存档 */ + @Excel(name = "是否存档") + private String pqArchiving; + + /** 授权状态 */ + @Excel(name = "授权状态") + private String pqEmpower; + + /** 提交状态 */ + @Excel(name = "提交状态") + private String pqApprovalStatus; + + + public void setPqId(String pqId) + { + this.pqId = pqId; + } + + public String getPqId() + { + return pqId; + } + public void setPqCode(String pqCode) + { + this.pqCode = pqCode; + } + + public String getPqCode() + { + return pqCode; + } + public void setPqSalesmanCode(String pqSalesmanCode) + { + this.pqSalesmanCode = pqSalesmanCode; + } + + public String getPqSalesmanCode() + { + return pqSalesmanCode; + } + public void setPqSalesmanBm(String pqSalesmanBm) + { + this.pqSalesmanBm = pqSalesmanBm; + } + + public String getPqSalesmanBm() + { + return pqSalesmanBm; + } + public void setPqSalesmanName(String pqSalesmanName) + { + this.pqSalesmanName = pqSalesmanName; + } + + public String getPqSalesmanName() + { + return pqSalesmanName; + } + public void setPqSalesmanDeptId(String pqSalesmanDeptId) + { + this.pqSalesmanDeptId = pqSalesmanDeptId; + } + + public String getPqSalesmanDeptId() + { + return pqSalesmanDeptId; + } + public void setPqSalesmanDeptName(String pqSalesmanDeptName) + { + this.pqSalesmanDeptName = pqSalesmanDeptName; + } + + public String getPqSalesmanDeptName() + { + return pqSalesmanDeptName; + } + public void setPqCustomerBm(String pqCustomerBm) + { + this.pqCustomerBm = pqCustomerBm; + } + + public String getPqCustomerBm() + { + return pqCustomerBm; + } + public void setPqCustomerName(String pqCustomerName) + { + this.pqCustomerName = pqCustomerName; + } + + public String getPqCustomerName() + { + return pqCustomerName; + } + public void setPqProject(String pqProject) + { + this.pqProject = pqProject; + } + + public String getPqProject() + { + return pqProject; + } + public void setPqBidWinningRemark(String pqBidWinningRemark) + { + this.pqBidWinningRemark = pqBidWinningRemark; + } + + public String getPqBidWinningRemark() + { + return pqBidWinningRemark; + } + public void setPqAuthorizedRepresentative(String pqAuthorizedRepresentative) + { + this.pqAuthorizedRepresentative = pqAuthorizedRepresentative; + } + + public String getPqAuthorizedRepresentative() + { + return pqAuthorizedRepresentative; + } + public void setPqBidDate(String pqBidDate) + { + this.pqBidDate = pqBidDate; + } + + public String getPqBidDate() + { + return pqBidDate; + } + public void setPqZbr(String pqZbr) + { + this.pqZbr = pqZbr; + } + + public String getPqZbr() + { + return pqZbr; + } + public void setPqBidWinningStatus(String pqBidWinningStatus) + { + this.pqBidWinningStatus = pqBidWinningStatus; + } + + public String getPqBidWinningStatus() + { + return pqBidWinningStatus; + } + public void setPqIllustrate(String pqIllustrate) + { + this.pqIllustrate = pqIllustrate; + } + + public String getPqIllustrate() + { + return pqIllustrate; + } + public void setPqAnnouncementLinkWebsite(String pqAnnouncementLinkWebsite) + { + this.pqAnnouncementLinkWebsite = pqAnnouncementLinkWebsite; + } + + public String getPqAnnouncementLinkWebsite() + { + return pqAnnouncementLinkWebsite; + } + public void setPqPhone(String pqPhone) + { + this.pqPhone = pqPhone; + } + + public String getPqPhone() + { + return pqPhone; + } + public void setPqAgency(String pqAgency) + { + this.pqAgency = pqAgency; + } + + public String getPqAgency() + { + return pqAgency; + } + public void setPqRemark(String pqRemark) + { + this.pqRemark = pqRemark; + } + + public String getPqRemark() + { + return pqRemark; + } + public void setPqArchiving(String pqArchiving) + { + this.pqArchiving = pqArchiving; + } + + public String getPqArchiving() + { + return pqArchiving; + } + public void setPqEmpower(String pqEmpower) + { + this.pqEmpower = pqEmpower; + } + + public String getPqEmpower() + { + return pqEmpower; + } + public String getPqApprovalStatus() { return pqApprovalStatus; } + + public void setPqApprovalStatus(String pqApprovalStatus) { this.pqApprovalStatus = pqApprovalStatus; } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/zgys/mapper/ZgysMapper.java b/ruoyi-system/src/main/java/com/ruoyi/zgys/mapper/ZgysMapper.java new file mode 100644 index 0000000..8792d6a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/zgys/mapper/ZgysMapper.java @@ -0,0 +1,68 @@ +package com.ruoyi.zgys.mapper; + +import java.util.List; +import com.ruoyi.zgys.domain.Zgys; + +/** + * 资格预审Mapper接口 + * + * @author ruoyi + * @date 2024-07-22 + */ +public interface ZgysMapper +{ + /** + * 查询资格预审 + * + * @param pqId 资格预审主键 + * @return 资格预审 + */ + public Zgys selectZgysByPqId(String pqId); + + /** + * 查询资格预审列表 + * + * @param zgys 资格预审 + * @return 资格预审集合 + */ + public List selectZgysList(Zgys zgys); + + /** + * 新增资格预审 + * + * @param zgys 资格预审 + * @return 结果 + */ + public int insertZgys(Zgys zgys); + + /** + * 修改资格预审 + * + * @param zgys 资格预审 + * @return 结果 + */ + public int updateZgys(Zgys zgys); + + /** + * 删除资格预审 + * + * @param pqId 资格预审主键 + * @return 结果 + */ + public int deleteZgysByPqId(String pqId); + + /** + * 批量删除资格预审 + * + * @param pqIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteZgysByPqIds(String[] pqIds); + + /** + * 获取单据编号 + * @param type + * @return + */ + String getCode(String type); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/zgys/service/IZgysService.java b/ruoyi-system/src/main/java/com/ruoyi/zgys/service/IZgysService.java new file mode 100644 index 0000000..cd1efe4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/zgys/service/IZgysService.java @@ -0,0 +1,68 @@ +package com.ruoyi.zgys.service; + +import java.util.List; +import com.ruoyi.zgys.domain.Zgys; + +/** + * 资格预审Service接口 + * + * @author ruoyi + * @date 2024-07-22 + */ +public interface IZgysService +{ + /** + * 查询资格预审 + * + * @param pqId 资格预审主键 + * @return 资格预审 + */ + public Zgys selectZgysByPqId(String pqId); + + /** + * 查询资格预审列表 + * + * @param zgys 资格预审 + * @return 资格预审集合 + */ + public List selectZgysList(Zgys zgys); + + /** + * 新增资格预审 + * + * @param zgys 资格预审 + * @return 结果 + */ + public int insertZgys(Zgys zgys); + + /** + * 修改资格预审 + * + * @param zgys 资格预审 + * @return 结果 + */ + public int updateZgys(Zgys zgys); + + /** + * 批量删除资格预审 + * + * @param pqIds 需要删除的资格预审主键集合 + * @return 结果 + */ + public int deleteZgysByPqIds(String[] pqIds); + + /** + * 删除资格预审信息 + * + * @param pqId 资格预审主键 + * @return 结果 + */ + public int deleteZgysByPqId(String pqId); + + /** + * 获取单据编号 + * @param type + * @return + */ + String getCode(String type); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/zgys/service/impl/ZgysServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/zgys/service/impl/ZgysServiceImpl.java new file mode 100644 index 0000000..8e476a5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/zgys/service/impl/ZgysServiceImpl.java @@ -0,0 +1,110 @@ +package com.ruoyi.zgys.service.impl; + +import java.util.List; + +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.zgys.mapper.ZgysMapper; +import com.ruoyi.zgys.domain.Zgys; +import com.ruoyi.zgys.service.IZgysService; + +/** + * 资格预审Service业务层处理 + * + * @author ruoyi + * @date 2024-07-22 + */ +@Service +public class ZgysServiceImpl implements IZgysService +{ + @Autowired + private ZgysMapper zgysMapper; + + /** + * 查询资格预审 + * + * @param pqId 资格预审主键 + * @return 资格预审 + */ + @Override + public Zgys selectZgysByPqId(String pqId) + { + return zgysMapper.selectZgysByPqId(pqId); + } + + /** + * 查询资格预审列表 + * + * @param zgys 资格预审 + * @return 资格预审 + */ + @Override + @DataScope(deptAlias = "d", userAlias = "u") + public List selectZgysList(Zgys zgys) + { + return zgysMapper.selectZgysList(zgys); + } + + /** + * 新增资格预审 + * + * @param zgys 资格预审 + * @return 结果 + */ + @Override + public int insertZgys(Zgys zgys) + { + zgys.setCreateTime(DateUtils.getNowDate()); + zgys.setUpdateTime(DateUtils.getNowDate()); + return zgysMapper.insertZgys(zgys); + } + + /** + * 修改资格预审 + * + * @param zgys 资格预审 + * @return 结果 + */ + @Override + public int updateZgys(Zgys zgys) + { + zgys.setUpdateTime(DateUtils.getNowDate()); + return zgysMapper.updateZgys(zgys); + } + + /** + * 批量删除资格预审 + * + * @param pqIds 需要删除的资格预审主键 + * @return 结果 + */ + @Override + public int deleteZgysByPqIds(String[] pqIds) + { + return zgysMapper.deleteZgysByPqIds(pqIds); + } + + /** + * 删除资格预审信息 + * + * @param pqId 资格预审主键 + * @return 结果 + */ + @Override + public int deleteZgysByPqId(String pqId) + { + return zgysMapper.deleteZgysByPqId(pqId); + } + + /** + * 获取单据编号 + * @param type + * @return + */ + @Override + public String getCode(String type) { + return zgysMapper.getCode(type); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/SysChangeRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysChangeRecordMapper.xml index 342588b..1144c69 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysChangeRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysChangeRecordMapper.xml @@ -12,7 +12,7 @@ beforeChange, afterChange, typeId, - remark, + codeName, #{changeTime}, @@ -21,7 +21,15 @@ #{beforeChange}, #{afterChange}, #{typeId}, - #{remark}, + #{codeName}, + + diff --git a/ruoyi-system/src/main/resources/mapper/zgys/ZgysMapper.xml b/ruoyi-system/src/main/resources/mapper/zgys/ZgysMapper.xml new file mode 100644 index 0000000..b1c926d --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/zgys/ZgysMapper.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + left join sys_user u on u.user_name=a.create_by + left join sys_dept d on u.dept_id = d.dept_id + + + + select a.pq_id, a.pq_code, a.pq_salesman_code, a.pq_salesman_bm, a.pq_salesman_name, + a.pq_salesman_dept_id, a.pq_salesman_dept_name, a.pq_customer_bm, + a.pq_customer_name, a.pq_project, a.pq_bid_winning_remark, a.pq_authorized_representative, + a.pq_bid_date, a.pq_zbr, a.pq_bid_winning_status, a.pq_illustrate, + a.pq_announcement_link_website, a.pq_phone, a.pq_agency, a.pq_remark, + a.pq_approval_status,a.pq_archiving, a.pq_empower, a.create_by, a.create_time, a.update_by, a.update_time + from zgys a + + + + + + + + + insert into zgys + + pq_id, + pq_code, + pq_salesman_code, + pq_salesman_bm, + pq_salesman_name, + pq_salesman_dept_id, + pq_salesman_dept_name, + pq_customer_bm, + pq_customer_name, + pq_project, + pq_bid_winning_remark, + pq_authorized_representative, + pq_bid_date, + pq_zbr, + pq_bid_winning_status, + pq_illustrate, + pq_announcement_link_website, + pq_phone, + pq_agency, + pq_remark, + pq_approval_status, + pq_archiving, + pq_empower, + create_by, + create_time, + update_by, + update_time, + + + #{pqId}, + #{pqCode}, + #{pqSalesmanCode}, + #{pqSalesmanBm}, + #{pqSalesmanName}, + #{pqSalesmanDeptId}, + #{pqSalesmanDeptName}, + #{pqCustomerBm}, + #{pqCustomerName}, + #{pqProject}, + #{pqBidWinningRemark}, + #{pqAuthorizedRepresentative}, + #{pqBidDate}, + #{pqZbr}, + #{pqBidWinningStatus}, + #{pqIllustrate}, + #{pqAnnouncementLinkWebsite}, + #{pqPhone}, + #{pqAgency}, + #{pqRemark}, + #{pqApprovalStatus}, + #{pqArchiving}, + #{pqEmpower}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update zgys + + pq_code = #{pqCode}, + pq_salesman_code = #{pqSalesmanCode}, + pq_salesman_bm = #{pqSalesmanBm}, + pq_salesman_name = #{pqSalesmanName}, + pq_salesman_dept_id = #{pqSalesmanDeptId}, + pq_salesman_dept_name = #{pqSalesmanDeptName}, + pq_customer_bm = #{pqCustomerBm}, + pq_customer_name = #{pqCustomerName}, + pq_project = #{pqProject}, + pq_bid_winning_remark = #{pqBidWinningRemark}, + pq_authorized_representative = #{pqAuthorizedRepresentative}, + pq_bid_date = #{pqBidDate}, + pq_zbr = #{pqZbr}, + pq_bid_winning_status = #{pqBidWinningStatus}, + pq_illustrate = #{pqIllustrate}, + pq_announcement_link_website = #{pqAnnouncementLinkWebsite}, + pq_phone = #{pqPhone}, + pq_agency = #{pqAgency}, + pq_remark = #{pqRemark}, + pq_approval_status = #{pqApprovalStatus}, + pq_archiving = #{pqArchiving}, + pq_empower = #{pqEmpower}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where pq_id = #{pqId} + + + + delete from zgys where pq_id = #{pqId} + + + + delete from zgys where pq_id in + + #{pqId} + + + + + diff --git a/ruoyi-ui/src/api/system/changeRecord.js b/ruoyi-ui/src/api/system/changeRecord.js new file mode 100644 index 0000000..242b7fa --- /dev/null +++ b/ruoyi-ui/src/api/system/changeRecord.js @@ -0,0 +1,11 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; + +// 获取变更记录 +export function recordsList(query) { + return request({ + url: '/system/changeRecord/recordsList', + method: 'get', + params: query + }) +} diff --git a/ruoyi-ui/src/api/zgys/zgys.js b/ruoyi-ui/src/api/zgys/zgys.js new file mode 100644 index 0000000..ce3ed35 --- /dev/null +++ b/ruoyi-ui/src/api/zgys/zgys.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询资格预审列表 +export function listZgys(query) { + return request({ + url: '/zgys/zgys/list', + method: 'get', + params: query + }) +} + +// 查询资格预审详细 +export function getZgys(pqId) { + return request({ + url: '/zgys/zgys/' + pqId, + method: 'get' + }) +} + +// 新增资格预审 +export function addZgys(data) { + return request({ + url: '/zgys/zgys', + method: 'post', + data: data + }) +} + +// 修改资格预审 +export function updateZgys(data) { + return request({ + url: '/zgys/zgys', + method: 'put', + data: data + }) +} + +// 删除资格预审 +export function delZgys(pqId) { + return request({ + url: '/zgys/zgys/' + pqId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/bid/bid/index.vue b/ruoyi-ui/src/views/bid/bid/index.vue index 835066d..04b399d 100644 --- a/ruoyi-ui/src/views/bid/bid/index.vue +++ b/ruoyi-ui/src/views/bid/bid/index.vue @@ -124,6 +124,17 @@ v-hasPermi="['bid:bid:assign']" >分派 + + 变更记录 +
@@ -223,7 +234,7 @@ - + - + - + + + @@ -289,7 +302,7 @@ - + @@ -846,6 +859,49 @@ + + + + + + + + + + + + 搜索 + + + + + + + + + + + +