From 235334711466f602955fff73c39ac52faff4e9c1 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 20 Dec 2023 13:58:18 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/largeScreen/service/impl/LargeScreenServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/largeScreen/service/impl/LargeScreenServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/largeScreen/service/impl/LargeScreenServiceImpl.java index e4d7a92b..229df537 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/largeScreen/service/impl/LargeScreenServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/largeScreen/service/impl/LargeScreenServiceImpl.java @@ -241,7 +241,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService { List valueList = commonUtil.setMaterialReturnData(list); num = valueList.get(0); num2 = valueList.get(1); - rate = commonUtil.getRate(num, num + num2); + rate = commonUtil.getRate(num2, num); } catch (Exception e) { log.error("当月退料分析", e); } From 36a3cb8268933372c1439d1c83c13fa0158e5283 Mon Sep 17 00:00:00 2001 From: dingjie Date: Wed, 20 Dec 2023 14:16:48 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/system/service/impl/SysFileServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysFileServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysFileServiceImpl.java index 62ec5e23..42c372f9 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysFileServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysFileServiceImpl.java @@ -48,7 +48,8 @@ public class SysFileServiceImpl implements SysFileService { FileInfo file = new FileInfo(); StandardMultipartHttpServletRequest req = (StandardMultipartHttpServletRequest) request; String photoType = req.getParameter("fileType"); - String userId = req.getParameter("userId"); +// String userId = req.getParameter("userId"); + Long userId = SecurityUtils.getUserId(); HashMap map = getFile(req); List items = (List) map.get("filePath"); MultipartFile item = items.get(0); @@ -61,7 +62,7 @@ public class SysFileServiceImpl implements SysFileService { long size = item.getSize()/1024/1024; file.setFileName(fileName); file.setFileUrl(url); - file.setCreator(userId); + file.setCreator(userId.toString()); file.setType(type); file.setSize(size + "M"); file.setWords(words); @@ -97,7 +98,7 @@ public class SysFileServiceImpl implements SysFileService { String tmpName = multipartFile.getOriginalFilename();// 完整路径 IE tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1); tmpName = IdUtil.fastSimpleUUID() + tmpName; - String imageFiles="/data/sz/zstp/" + fileType + "/"; + String imageFiles="/data/sgzb/" + fileType + "/"; String os = System.getProperty("os.name"); if(os.toLowerCase().startsWith("win")){ imageFiles="D://files/" + fileType + "/"; From e5cbbafb14596b369c1a8cdd4537da20f93897dc Mon Sep 17 00:00:00 2001 From: bns_han <1604366271@qq.com> Date: Wed, 20 Dec 2023 14:39:09 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E7=A7=BB=E5=8A=A8-=E9=80=80=E6=96=99?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AF=A6=E6=83=85=E8=AF=B7=E6=B1=82=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/sgzb/app/controller/BackApplyController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java index 8c7e2afe..7f13331b 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java @@ -89,7 +89,7 @@ public class BackApplyController extends BaseController { * @return AjaxResult对象 */ @Log(title = "退料详情查看", businessType = BusinessType.QUERY) - @GetMapping("view") + @PostMapping("view") public AjaxResult view(@RequestBody BackApplyInfo record) { try { List list =backApplyService.view(record); From fc0d7cac8ad7c47ed9641e154d24bb84c069a98a Mon Sep 17 00:00:00 2001 From: liuchuan <1084917737@qq.com> Date: Wed, 20 Dec 2023 15:14:55 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=BB=B4=E4=BF=AE?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/sgzb/base/service/impl/RepairServiceImpl.java | 4 ---- .../sgzb-base/src/main/resources/mapper/base/RepairMapper.xml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java index 54eeec15..0a0134a8 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java @@ -1,16 +1,12 @@ package com.bonus.sgzb.base.service.impl; -import cn.hutool.http.server.HttpServerRequest; import com.bonus.sgzb.base.domain.RepairApplyRecord; import com.bonus.sgzb.base.domain.RepairPartDetails; import com.bonus.sgzb.base.domain.RepairTask; import com.bonus.sgzb.base.domain.RepairTaskDetails; -import com.bonus.sgzb.base.domain.vo.TreeSelect; import com.bonus.sgzb.base.domain.vo.dictVo; import com.bonus.sgzb.base.mapper.RepairMapper; import com.bonus.sgzb.base.service.RepairService; -import com.bonus.sgzb.common.core.constant.TokenConstants; -import com.bonus.sgzb.common.core.utils.SpringUtils; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.security.service.TokenService; import com.bonus.sgzb.common.security.utils.SecurityUtils; diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/RepairMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/RepairMapper.xml index 00b81d4a..9ef3ee62 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/RepairMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/RepairMapper.xml @@ -86,7 +86,7 @@ LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id - LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id + LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id and bpi.status = '0' and bpi.del_flag = '0' left join sys_user su on rd.create_by = su.user_id left join sys_dic sd on sd.id = tt.task_status where 1=1 From 7e5b48872f15eae594f43eddb2f7da25479af5a8 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 20 Dec 2023 15:32:26 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E7=BB=9F=E4=B8=80-=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/SelectController.java | 35 ++++++++++++++ .../bonus/sgzb/system/domain/SelectDto.java | 13 +++++ .../bonus/sgzb/system/domain/SelectVo.java | 16 +++++++ .../sgzb/system/mapper/SelectMapper.java | 32 +++++++++++++ .../sgzb/system/service/SelectService.java | 29 ++++++++++++ .../service/impl/SelectServiceImpl.java | 47 +++++++++++++++++++ .../resources/mapper/system/SelectMapper.xml | 44 +++++++++++++++++ 7 files changed, 216 insertions(+) create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectVo.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java create mode 100644 sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java new file mode 100644 index 00000000..be2cee5c --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java @@ -0,0 +1,35 @@ +package com.bonus.sgzb.system.controller; + +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.system.domain.SelectDto; +import com.bonus.sgzb.system.service.SelectService; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * @author 10488 + * 统一下拉选 + */ +@RestController +@RequestMapping("/select/") +public class SelectController { + + @Resource(name = "SelectService") + private SelectService service; + + @ApiOperation(value = "往来单位下拉选") + @PostMapping("getUnitData") + public AjaxResult getUnitData(SelectDto dto) { + return service.getUnitData(dto); + } + + @ApiOperation(value = "工程下拉选") + @PostMapping("getProData") + public AjaxResult getProData(SelectDto dto) { + return service.getProData(dto); + } +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java new file mode 100644 index 00000000..7d400068 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java @@ -0,0 +1,13 @@ +package com.bonus.sgzb.system.domain; + +import lombok.Data; + +/** + * @author 10488 + */ +@Data +public class SelectDto { + + /** 参数id*/ + private String id; +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectVo.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectVo.java new file mode 100644 index 00000000..2b0814f2 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectVo.java @@ -0,0 +1,16 @@ +package com.bonus.sgzb.system.domain; + +import lombok.Data; + +/** + * @author 10488 + */ +@Data +public class SelectVo { + + /** id*/ + private long id; + + /** 名称*/ + private String titleName; +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java new file mode 100644 index 00000000..b894e303 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java @@ -0,0 +1,32 @@ +package com.bonus.sgzb.system.mapper; + +import com.bonus.sgzb.system.domain.SelectDto; +import com.bonus.sgzb.system.domain.SelectVo; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author 10488 + * 统一下拉选 + */ +@Repository("SelectMapper") +public interface SelectMapper { + /** + * @param dto + * @return List + * @description 往来单位 + * @author cwchen + * @date 2023/12/20 14:23 + */ + List getUnitData(SelectDto dto); + + /** + * @param dto + * @return List + * @description 工程 + * @author cwchen + * @date 2023/12/20 15:05 + */ + List getProData(SelectDto dto); +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java new file mode 100644 index 00000000..8466a82b --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java @@ -0,0 +1,29 @@ +package com.bonus.sgzb.system.service; + +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.system.domain.SelectDto; + +/** + * @author 10488 + * 统一下拉选 + */ +public interface SelectService { + + /** + * @param dto + * @return AjaxResult + * @description 往来单位 + * @author cwchen + * @date 2023/12/20 14:20 + */ + AjaxResult getUnitData(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 工程 + * @author cwchen + * @date 2023/12/20 15:04 + */ + AjaxResult getProData(SelectDto dto); +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java new file mode 100644 index 00000000..639874e2 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java @@ -0,0 +1,47 @@ +package com.bonus.sgzb.system.service.impl; + +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.system.domain.SelectDto; +import com.bonus.sgzb.system.domain.SelectVo; +import com.bonus.sgzb.system.mapper.SelectMapper; +import com.bonus.sgzb.system.service.SelectService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 10488 + * 统一下拉选 + */ +@Service("SelectService") +@Slf4j +public class SelectServiceImpl implements SelectService { + + @Resource(name = "SelectMapper") + private SelectMapper mapper; + + @Override + public AjaxResult getUnitData(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getUnitData(dto); + } catch (Exception e) { + log.error("往来单位-查询失败",e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getProData(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getProData(dto); + } catch (Exception e) { + log.error("工程-查询失败",e); + } + return AjaxResult.success(list); + } +} diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml new file mode 100644 index 00000000..499e6738 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + \ No newline at end of file From c080856e1444cf288ddf8bd38759d0b5cbfccfc9 Mon Sep 17 00:00:00 2001 From: dingjie Date: Wed, 20 Dec 2023 16:08:03 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=B7=A8=E5=9F=9F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/base/api/domain/MaType.java | 6 +++ .../sgzb/system/config/ResourcesConfig.java | 51 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/config/ResourcesConfig.java diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java index ba542460..f5a6f6a4 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java @@ -1,6 +1,7 @@ package com.bonus.sgzb.base.api.domain; import com.bonus.sgzb.common.core.web.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -61,6 +62,11 @@ public class MaType extends BaseEntity { @ApiModelProperty(value = "租赁单价") private String leasePrice; + /** 租赁单价 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "租赁单价") + private Date effTime; + @ApiModelProperty(value = "外部价格") private String rentPrice; diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/config/ResourcesConfig.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/config/ResourcesConfig.java new file mode 100644 index 00000000..75947bfc --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/config/ResourcesConfig.java @@ -0,0 +1,51 @@ +package com.bonus.sgzb.system.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.io.File; + +/** + * 通用映射配置 + * + * @author ruoyi + */ +@Configuration +public class ResourcesConfig implements WebMvcConfigurer +{ + /** + * 上传文件存储在本地的根路径 + */ + @Value("${file.path}") + private String localFilePath; + + /** + * 资源映射路径 前缀 + */ + @Value("${file.prefix}") + public String localFilePrefix; + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) + { + /** 本地文件上传路径 */ + registry.addResourceHandler("/**") + .addResourceLocations("file:" + localFilePath + File.separator); + } + + /** + * 开启跨域 + */ + @Override + public void addCorsMappings(CorsRegistry registry) { + // 设置允许跨域的路由 + registry.addMapping( "/**") + // 设置允许跨域请求的域名 + .allowedOrigins("*") + // 设置允许的方法 + .allowedMethods("GET"); + } +} \ No newline at end of file From 22700028052d2ce35140f29562d25f450f8d2f99 Mon Sep 17 00:00:00 2001 From: bns_han <1604366271@qq.com> Date: Wed, 20 Dec 2023 17:04:29 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E7=A7=BB=E5=8A=A8-=E9=80=80=E6=96=99?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AF=B7=E6=B1=82=E6=96=B9=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/app/controller/BackApplyController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java index 7f13331b..8a1753c1 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java @@ -106,7 +106,7 @@ public class BackApplyController extends BaseController { * @return AjaxResult对象 */ @Log(title = "退料审核明细", businessType = BusinessType.QUERY) - @GetMapping("examineView") + @PostMapping("examineView") public AjaxResult examineView(@RequestBody BackApplyInfo record) { try { List list =backApplyService.examineView(record); @@ -123,7 +123,7 @@ public class BackApplyController extends BaseController { * @return AjaxResult对象 */ @Log(title = "退料删除", businessType = BusinessType.QUERY) - @GetMapping("del") + @PostMapping("del") public AjaxResult del(@RequestBody BackApplyInfo record) { try { int re =backApplyService.del(record); @@ -144,7 +144,7 @@ public class BackApplyController extends BaseController { * @return AjaxResult对象 */ @Log(title = "退料申请-退料单位", businessType = BusinessType.QUERY) - @GetMapping("getbackUnit") + @PostMapping("getbackUnit") public AjaxResult getbackUnit(@RequestBody BmAgreementInfo record) { try { List list =backApplyService.getbackUnit(record); @@ -161,7 +161,7 @@ public class BackApplyController extends BaseController { * @return AjaxResult对象 */ @Log(title = "退料申请-退料工程", businessType = BusinessType.QUERY) - @GetMapping("getbackPro") + @PostMapping("getbackPro") public AjaxResult getbackPro(@RequestBody BmAgreementInfo record) { try { List list =backApplyService.getbackPro(record); From c6875f0f8b155508f6e87ecfa133ac0aea1313dc Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 20 Dec 2023 18:09:46 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/SelectController.java | 43 ++++++++++ .../bonus/sgzb/system/domain/SelectDto.java | 9 +++ .../bonus/sgzb/system/domain/SelectVo.java | 2 +- .../bonus/sgzb/system/domain/TreeNode.java | 24 ++++++ .../sgzb/system/mapper/SelectMapper.java | 55 +++++++++++++ .../sgzb/system/service/SelectService.java | 63 +++++++++++++++ .../service/impl/SelectServiceImpl.java | 80 ++++++++++++++++++- .../com/bonus/sgzb/system/util/TreeBuild.java | 79 ++++++++++++++++++ .../resources/mapper/system/SelectMapper.xml | 55 ++++++++++++- 9 files changed, 403 insertions(+), 7 deletions(-) create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/TreeNode.java create mode 100644 sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/util/TreeBuild.java diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java index be2cee5c..e33d48e5 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SelectController.java @@ -32,4 +32,47 @@ public class SelectController { public AjaxResult getProData(SelectDto dto) { return service.getProData(dto); } + + @ApiOperation(value = "机具类型下拉选") + @PostMapping("getMaTypeData") + public AjaxResult getMaTypeData(SelectDto dto){ + return service.getMaTypeData(dto); + } + + @ApiOperation(value = "机具类型下拉树") + @PostMapping("getMaTypeTreeData") + public AjaxResult getMaTypeTreeData(SelectDto dto){ +// return service.getMaTypeTreeData(dto); + return null; + } + + @ApiOperation(value = "数据字典下拉选") + @PostMapping("getDictByPidCbx") + public AjaxResult getDictByPidCbx(SelectDto dto){ + return service.getDictByPidCbx(dto); + } + + @ApiOperation(value = "单位树/归属部门/所属上级") + @PostMapping("getDeptTree") + public AjaxResult getDeptTree(SelectDto dto){ + return service.getDeptTree(dto); + } + + @ApiOperation(value = "岗位下拉选") + @PostMapping("getPostCbx") + public AjaxResult getPostCbx(SelectDto dto){ + return service.getPostCbx(dto); + } + + @ApiOperation(value = "角色下拉选") + @PostMapping("getRoleCbx") + public AjaxResult getRoleCbx(SelectDto dto){ + return service.getRoleCbx(dto); + } + + @ApiOperation(value = "单位类型下拉选") + @PostMapping("getUnitTypeCbx") + public AjaxResult getUnitTypeCbx(SelectDto dto){ + return service.getUnitTypeCbx(dto); + } } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java index 7d400068..1f87e261 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectDto.java @@ -10,4 +10,13 @@ public class SelectDto { /** 参数id*/ private String id; + + /** 2.物品种类 3.设备类型 4.规格型号*/ + private String type; + + /** 字典表 父类值*/ + private String parentValue; + + /** 层级*/ + private String level; } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectVo.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectVo.java index 2b0814f2..82c74508 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectVo.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/SelectVo.java @@ -12,5 +12,5 @@ public class SelectVo { private long id; /** 名称*/ - private String titleName; + private String name; } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/TreeNode.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/TreeNode.java new file mode 100644 index 00000000..01b73bd7 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/TreeNode.java @@ -0,0 +1,24 @@ +package com.bonus.sgzb.system.domain; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author 10488 + * 下拉树-实体类 + */ +@Data +public class TreeNode { + + private long id; + + private String label; + + private long parentId; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children = new ArrayList<>(); +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java index b894e303..10f8a298 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/SelectMapper.java @@ -2,6 +2,7 @@ package com.bonus.sgzb.system.mapper; import com.bonus.sgzb.system.domain.SelectDto; import com.bonus.sgzb.system.domain.SelectVo; +import com.bonus.sgzb.system.domain.TreeNode; import org.springframework.stereotype.Repository; import java.util.List; @@ -29,4 +30,58 @@ public interface SelectMapper { * @date 2023/12/20 15:05 */ List getProData(SelectDto dto); + + /** + * @param dto + * @return List + * @description 机具类型 + * @author cwchen + * @date 2023/12/20 16:02 + */ + List getMaTypeData(SelectDto dto); + + /** + * @param dto + * @return List + * @description 数据字典下拉选 + * @author cwchen + * @date 2023/12/20 16:23 + */ + List getDictByPidCbx(SelectDto dto); + + /** + * @param dto + * @return List + * @description 单位树/归属部门/所属上级 + * @author cwchen + * @date 2023/12/20 17:10 + */ + List getDeptTree(SelectDto dto); + + /** + * @param dto + * @return List + * @description 岗位下拉选 + * @author cwchen + * @date 2023/12/20 17:50 + */ + List getPostCbx(SelectDto dto); + + /** + * @param dto + * @return List + * @description 角色下拉选 + * @author cwchen + * @date 2023/12/20 17:56 + */ + List getRoleCbx(SelectDto dto); + + /** + * @param dto + * @return List + * @description 单位类型下拉选 + * @author cwchen + * @date 2023/12/20 18:01 + */ + List getUnitTypeCbx(SelectDto dto); } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java index 8466a82b..5aef44f8 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/SelectService.java @@ -26,4 +26,67 @@ public interface SelectService { * @date 2023/12/20 15:04 */ AjaxResult getProData(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 机具类型 + * @author cwchen + * @date 2023/12/20 16:02 + */ + AjaxResult getMaTypeData(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 机具类型-下拉树 + * @author cwchen + * @date 2023/12/20 16:10 + */ +// AjaxResult getMaTypeTreeData(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 数据字典下拉选 + * @author cwchen + * @date 2023/12/20 16:22 + */ + AjaxResult getDictByPidCbx(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 单位树/归属部门/所属上级 + * @author cwchen + * @date 2023/12/20 16:36 + */ + AjaxResult getDeptTree(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 岗位下拉树 + * @author cwchen + * @date 2023/12/20 17:45 + */ + AjaxResult getPostCbx(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 角色下拉选 + * @author cwchen + * @date 2023/12/20 17:56 + */ + AjaxResult getRoleCbx(SelectDto dto); + + /** + * @param dto + * @return AjaxResult + * @description 单位类型下拉选 + * @author cwchen + * @date 2023/12/20 18:00 + */ + AjaxResult getUnitTypeCbx(SelectDto dto); } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java index 639874e2..522630c4 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SelectServiceImpl.java @@ -3,9 +3,12 @@ package com.bonus.sgzb.system.service.impl; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.system.domain.SelectDto; import com.bonus.sgzb.system.domain.SelectVo; +import com.bonus.sgzb.system.domain.TreeNode; import com.bonus.sgzb.system.mapper.SelectMapper; import com.bonus.sgzb.system.service.SelectService; +import com.bonus.sgzb.system.util.TreeBuild; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -29,7 +32,7 @@ public class SelectServiceImpl implements SelectService { try { list = mapper.getUnitData(dto); } catch (Exception e) { - log.error("往来单位-查询失败",e); + log.error("往来单位-查询失败", e); } return AjaxResult.success(list); } @@ -40,7 +43,80 @@ public class SelectServiceImpl implements SelectService { try { list = mapper.getProData(dto); } catch (Exception e) { - log.error("工程-查询失败",e); + log.error("工程-查询失败", e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getMaTypeData(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getMaTypeData(dto); + } catch (Exception e) { + log.error("机具类型-查询失败", e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getDictByPidCbx(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getDictByPidCbx(dto); + } catch (Exception e) { + log.error("数据字典-查询失败", e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getDeptTree(SelectDto dto) { + List groupList = new ArrayList<>(); + List list = new ArrayList<>(); + try { + list = mapper.getDeptTree(dto); + if (CollectionUtils.isNotEmpty(list)) { + // 创建树形结构(数据集合作为参数) + TreeBuild treeBuild = new TreeBuild(list); + // 原查询结果转换树形结构 + groupList = treeBuild.buildTree(); + } + } catch (Exception e) { + log.error("单位树/归属部门/所属上级-查询失败", e); + } + return AjaxResult.success(groupList); + } + + @Override + public AjaxResult getPostCbx(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getPostCbx(dto); + } catch (Exception e) { + log.error("岗位下拉选-查询失败", e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getRoleCbx(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getRoleCbx(dto); + } catch (Exception e) { + log.error("角色下拉选-查询失败", e); + } + return AjaxResult.success(list); + } + + @Override + public AjaxResult getUnitTypeCbx(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getUnitTypeCbx(dto); + } catch (Exception e) { + log.error("单位类型下拉选-查询失败", e); } return AjaxResult.success(list); } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/util/TreeBuild.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/util/TreeBuild.java new file mode 100644 index 00000000..14266829 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/util/TreeBuild.java @@ -0,0 +1,79 @@ +package com.bonus.sgzb.system.util; + +import com.bonus.sgzb.system.domain.TreeNode; + +import java.util.ArrayList; +import java.util.List; + +/** + * BuildTree 构建树形结构 + * @author 10488 + */ +public class TreeBuild { + + public List nodeList = new ArrayList<>(); + + /** + * 构造方法 + * @param nodeList 将数据集合赋值给nodeList,即所有数据作为所有节点。 + */ + public TreeBuild(List nodeList){ + this.nodeList = nodeList; + } + + /** + * 获取需构建的所有根节点(顶级节点) "0" + * @return 所有根节点List集合 + */ + public List getRootNode(){ + // 保存所有根节点(所有根节点的数据) + List rootNodeList = new ArrayList<>(); + // treeNode:查询出的每一条数据(节点) + for (TreeNode treeNode : nodeList){ + // 判断当前节点是否为根节点,此处注意:若parentId类型是String,则要采用equals()方法判断。 + if (0 == treeNode.getParentId()) { + // 是,添加 + rootNodeList.add(treeNode); + } + } + return rootNodeList; + } + + /** + * 根据每一个顶级节点(根节点)进行构建树形结构 + * @return 构建整棵树 + */ + public List buildTree(){ + // treeNodes:保存一个顶级节点所构建出来的完整树形 + List treeNodes = new ArrayList(); + // getRootNode():获取所有的根节点 + for (TreeNode treeRootNode : getRootNode()) { + // 将顶级节点进行构建子树 + treeRootNode = buildChildTree(treeRootNode); + // 完成一个顶级节点所构建的树形,增加进来 + treeNodes.add(treeRootNode); + } + return treeNodes; + } + + /** + * 递归-----构建子树形结构 + * @param pNode 根节点(顶级节点) + * @return 整棵树 + */ + public TreeNode buildChildTree(TreeNode pNode){ + List childTree = new ArrayList(); + // nodeList:所有节点集合(所有数据) + for (TreeNode treeNode : nodeList) { + // 判断当前节点的父节点ID是否等于根节点的ID,即当前节点为其下的子节点 + if (treeNode.getParentId() == pNode.getId()) { + // 再递归进行判断当前节点的情况,调用自身方法 + childTree.add(buildChildTree(treeNode)); + } + } + // for循环结束,即节点下没有任何节点,树形构建结束,设置树结果 + pNode.setChildren(childTree); + return pNode; + } + +} diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml index 499e6738..e9cfd076 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml @@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" /*根据标段工程id关联协议查询往来单位*/ SELECT DISTINCT bui.unit_id AS id, - bui.unit_name AS titleName + bui.unit_name AS `name` FROM bm_project_lot bpl LEFT JOIN bm_agreement_info bai ON bpl.lot_id = bai.project_id AND bai.`status` = '1' LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id AND bui.del_flag = '0' @@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT unit_id AS id, - unit_name AS titleName + unit_name AS `name` FROM bm_unit_info WHERE del_flag = '0' @@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" /*根据往来单位id关联协议查询工程*/ SELECT DISTINCT bpl.lot_id AS id, - bpl.lot_name AS titleName + bpl.lot_name AS `name` FROM bm_unit_info bui LEFT JOIN bm_agreement_info bai ON bui.unit_id = bai.unit_id AND bai.`status` = '1' LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id AND bpl.del_flag = '0' @@ -36,9 +36,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT lot_id AS id, - lot_name AS titleName + lot_name AS `name` FROM bm_project_lot WHERE del_flag = '0' + + + + + + + + + + + + + \ No newline at end of file From 79c261b23528305ef081afdfee2c937fa413d119 Mon Sep 17 00:00:00 2001 From: dingjie Date: Wed, 20 Dec 2023 18:49:09 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/base/mapper/MaLabelBindMapper.java | 5 ++++ .../mapper/base/MaLabelBindMapper.xml | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java index 0287fdd1..2b39c205 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java @@ -1,7 +1,9 @@ package com.bonus.sgzb.base.mapper; import java.util.List; +import com.bonus.sgzb.base.domain.MaLabelBind; import com.bonus.sgzb.base.vo.MaLabelBindVO; +import org.apache.ibatis.annotations.Mapper; /** * 机具设备标签ma_label_bindMapper接口 @@ -9,6 +11,7 @@ import com.bonus.sgzb.base.vo.MaLabelBindVO; * @author bonus * @date 2023-12-13 */ +@Mapper public interface MaLabelBindMapper { /** @@ -65,4 +68,6 @@ public interface MaLabelBindMapper * @return 结果 */ public int updateMaLabelBindByMaIds(Long maId); + + int insertLabelBind(MaLabelBind maLabelBind); } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml index 7268eb08..01c22947 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaLabelBindMapper.xml @@ -87,6 +87,7 @@ insert into ma_label_bind + ma_id, label_code, type_id, binder, @@ -96,6 +97,7 @@ status, + #{maId}, #{labelCode}, #{typeId}, #{binder}, @@ -105,6 +107,30 @@ #{status}, + + insert into ma_label_bind + + ma_id, + label_code, + type_id, + binder, + label_type, + company_id, + binder_time, + status, + + + #{maId}, + #{labelCode}, + #{typeId}, + #{binder}, + #{labelType}, + #{companyId}, + #{binderTime}, + #{status}, + + + update ma_label_bind From a94970c6150d0072d800390fd735b459b3f0def3 Mon Sep 17 00:00:00 2001 From: bns_han <1604366271@qq.com> Date: Wed, 20 Dec 2023 19:47:26 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E7=A7=BB=E5=8A=A8-=E9=80=80=E6=96=99?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/sgzb/app/domain/BackApplyInfo.java | 5 +++++ .../src/main/resources/mapper/app/BackApplyMapper.xml | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java index 87618774..6c6e55c3 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java @@ -81,4 +81,9 @@ public class BackApplyInfo { * 审核备注 */ private String directAuditRemark; + private String code; + private String backPerson; + private String lotId; + private String unitId; + private String backTime; } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackApplyMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackApplyMapper.xml index f067c8a7..a41bc8b8 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackApplyMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackApplyMapper.xml @@ -305,12 +305,16 @@