From 8c755f964465aef65383ddb3e7f48629852e2f29 Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Wed, 26 Mar 2025 17:42:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=9C=80=E6=B1=82=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=BD=92=E8=BF=98=E6=97=A5=E6=9C=9F=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E6=94=B9=E4=B8=BA=E9=A2=84=E8=AE=A1=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/entity/PlanDataDetailBean.java | 5 +- .../mappers/app/PartApplyAppMapper.xml | 204 +++++++++++------- 2 files changed, 125 insertions(+), 84 deletions(-) diff --git a/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanDataDetailBean.java b/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanDataDetailBean.java index 283cb72..ab0dff9 100644 --- a/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanDataDetailBean.java +++ b/src/main/java/com/bonus/gzgqj/business/plan/entity/PlanDataDetailBean.java @@ -51,14 +51,15 @@ public class PlanDataDetailBean { @Excel(name = "需用量", width = 10.0,height = 20.0, orderNum = "6") private int needNum; /** - * 需用天数 + * 预计使用时间 */ - @Excel(name = "需用天数", width = 10.0,height = 20.0, orderNum = "7") + private String times; /** * 退还日期 */ + @Excel(name = "预计使用时间", width = 15.0,height = 20.0, orderNum = "7") private String backDate; /** diff --git a/src/main/resources/mappers/app/PartApplyAppMapper.xml b/src/main/resources/mappers/app/PartApplyAppMapper.xml index 65c83c1..deddace 100644 --- a/src/main/resources/mappers/app/PartApplyAppMapper.xml +++ b/src/main/resources/mappers/app/PartApplyAppMapper.xml @@ -1,34 +1,34 @@ - + INSERT INTO t_part_apply( - code, creator, user_name, create_time, type, remark, status, updater, - update_time, - - dev_id, - - dev_code, dev_type, - - pro_id, - - pro_name, - apply_num,status_type)values( - #{code},#{creator},#{userName},now(), #{type},#{remark},#{status},#{updater}, now(), - - #{deviceId}, - - #{devCode}, #{devType}, - - #{proId}, - - #{proName},#{applyNum},#{statusType}) + code, creator, user_name, create_time, type, remark, status, updater, + update_time, + + dev_id, + + dev_code, dev_type, + + pro_id, + + pro_name, + apply_num,status_type)values( + #{code},#{creator},#{userName},now(), #{type},#{remark},#{status},#{updater}, now(), + + #{deviceId}, + + #{devCode}, #{devType}, + + #{proId}, + + #{proName},#{applyNum},#{statusType}) insert into t_part_apply_details( - apply_id, part_id, apply_num,remark, + apply_id, part_id, apply_num,remark, part_type, part_name, part_model,part_unit ) values (#{param.id},#{item.partId},#{item.applyNum},#{item.remark}, @@ -105,45 +105,49 @@ and ( - mt2.NAME like concat('%',#{keyWord},'%') or - mt3.NAME like concat('%',#{keyWord},'%') or + mt2.NAME like concat('%',#{keyWord},'%') or + mt3.NAME like concat('%',#{keyWord},'%') or mm.DEVICE_CODE like concat('%',#{keyWord},'%') or - mt.NAME like concat('%',#{keyWord},'%') + mt.NAME like concat('%',#{keyWord},'%') ) - + select wir.sup_id, + wat.AGREEMENT_ID, + wir.id, + pro.`NAME` proName, + pro.Id proId from wf_info_record wir - LEFT JOIN wf_return_material_details rmd on wir.SUP_ID=rmd.id - LEFT JOIN wf_agreement_task wat on rmd.TASK_ID=wat.TASK_ID - LEFT JOIN wf_lease_agreement wla on wat.AGREEMENT_ID=wla.id - left join bm_project pro on pro.id=wla.PROJECT - where TYPE=4 AND wir.MA_ID=#{id} - ORDER BY wir.TIME DESC - limit 1 + LEFT JOIN wf_return_material_details rmd on wir.SUP_ID = rmd.id + LEFT JOIN wf_agreement_task wat on rmd.TASK_ID = wat.TASK_ID + LEFT JOIN wf_lease_agreement wla on wat.AGREEMENT_ID = wla.id + left join bm_project pro on pro.id = wla.PROJECT + where TYPE = 4 + AND wir.MA_ID = #{id} + ORDER BY wir.TIME DESC limit 1 @@ -180,51 +188,83 @@ when 3 THEN '已驳回' when 4 THEN '已出库' else '待审核' - END as statusName, + END as statusName, CASE tpa.type - when 0 then '设备' + when 0 then '设备' when 1 then '工器具' else '工器具' - END as typeName + END as typeName FROM t_part_apply tpa and ( - tpa.code like concat('%',#{keyWord},'%') or - tpa.user_name like concat('%',#{keyWord},'%') + tpa.code like concat('%',#{keyWord},'%') or + tpa.user_name like concat('%',#{keyWord},'%') ) - and STR_TO_DATE(tpa.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d') + and STR_TO_DATE(tpa.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND + STR_TO_DATE(#{endDay},'%Y-%m-%d') -order by tpa.create_time desc + order by tpa.create_time desc \ No newline at end of file From ec57c156423d4ce5cd471935ee00e114f94991f8 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Wed, 23 Apr 2025 13:20:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E6=96=87=E5=90=8D=E5=92=8C=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bases/controller/PartInputController.java | 11 ++++++++- .../bases/mapper/PartInputMapper.java | 10 +++++++- .../bases/service/PartInputService.java | 8 +++++++ .../bases/service/PartInputServiceImpl.java | 23 ++++++++++++++++++- .../mappers/bases/PartInputMapper.xml | 6 +++++ 5 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/bonus/gzgqj/business/bases/controller/PartInputController.java b/src/main/java/com/bonus/gzgqj/business/bases/controller/PartInputController.java index 82537a2..def7cc9 100644 --- a/src/main/java/com/bonus/gzgqj/business/bases/controller/PartInputController.java +++ b/src/main/java/com/bonus/gzgqj/business/bases/controller/PartInputController.java @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import com.bonus.gzgqj.business.bases.entity.PartInputDetails; import com.bonus.gzgqj.business.bases.entity.PartInputVo; +import com.bonus.gzgqj.business.bases.entity.UserPatypeInfo; import com.bonus.gzgqj.business.bases.service.PartInputService; import com.bonus.gzgqj.business.plan.entity.PlanApplyBean; import com.bonus.gzgqj.business.plan.entity.PlanApplyBeanPlanExport; @@ -177,6 +178,14 @@ public class PartInputController { return ServerResponse.createSuccess(list); } - + /** + * 获取中文名 + * @return + */ + @PostMapping("getUserName") + @DecryptAndVerify(decryptedClass = UserPatypeInfo.class) + public ServerResponse getUserName(EncryptedReq dto) { + return service.getUserName(dto.getData()); + } } diff --git a/src/main/java/com/bonus/gzgqj/business/bases/mapper/PartInputMapper.java b/src/main/java/com/bonus/gzgqj/business/bases/mapper/PartInputMapper.java index 8b0e72d..885b84c 100644 --- a/src/main/java/com/bonus/gzgqj/business/bases/mapper/PartInputMapper.java +++ b/src/main/java/com/bonus/gzgqj/business/bases/mapper/PartInputMapper.java @@ -4,6 +4,7 @@ import com.bonus.gzgqj.business.bases.entity.PaTypeVo; import com.bonus.gzgqj.business.bases.entity.PartInputDetails; import com.bonus.gzgqj.business.bases.entity.PartInputVo; +import com.bonus.gzgqj.business.bases.entity.UserPatypeInfo; import org.springframework.stereotype.Repository; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -75,7 +76,7 @@ public interface PartInputMapper { /** * 修改 入库信息 - * @param list + * @param data */ int uploadDetails(PartInputDetails data); @@ -91,4 +92,11 @@ public interface PartInputMapper { * @return */ String getPzPrice(PartInputDetails detail); + + /** + * 查询入库详情 + * @param vo + * @return + */ + UserPatypeInfo getUserName(UserPatypeInfo vo); } diff --git a/src/main/java/com/bonus/gzgqj/business/bases/service/PartInputService.java b/src/main/java/com/bonus/gzgqj/business/bases/service/PartInputService.java index 69130e3..34e5dbb 100644 --- a/src/main/java/com/bonus/gzgqj/business/bases/service/PartInputService.java +++ b/src/main/java/com/bonus/gzgqj/business/bases/service/PartInputService.java @@ -2,6 +2,7 @@ package com.bonus.gzgqj.business.bases.service; import com.bonus.gzgqj.business.bases.entity.PartInputDetails; import com.bonus.gzgqj.business.bases.entity.PartInputVo; +import com.bonus.gzgqj.business.bases.entity.UserPatypeInfo; import com.bonus.gzgqj.manager.webResult.ServerResponse; import org.springframework.web.multipart.MultipartFile; @@ -48,4 +49,11 @@ public interface PartInputService { * @return */ ServerResponse updateInputData(HttpServletRequest request, MultipartFile[] files); + + /** + * 获取中文名 + * @param data + * @return + */ + ServerResponse getUserName(UserPatypeInfo data); } diff --git a/src/main/java/com/bonus/gzgqj/business/bases/service/PartInputServiceImpl.java b/src/main/java/com/bonus/gzgqj/business/bases/service/PartInputServiceImpl.java index 6837dd8..4aa6148 100644 --- a/src/main/java/com/bonus/gzgqj/business/bases/service/PartInputServiceImpl.java +++ b/src/main/java/com/bonus/gzgqj/business/bases/service/PartInputServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; import com.bonus.gzgqj.business.bases.entity.PaTypeVo; import com.bonus.gzgqj.business.bases.entity.PartInputDetails; import com.bonus.gzgqj.business.bases.entity.PartInputVo; +import com.bonus.gzgqj.business.bases.entity.UserPatypeInfo; import com.bonus.gzgqj.business.bases.mapper.PartInputMapper; import com.bonus.gzgqj.business.plan.entity.FileUploadVo; import com.bonus.gzgqj.business.utils.FileUploadService; @@ -83,7 +84,7 @@ public class PartInputServiceImpl implements PartInputService{ } Long userId= Objects.requireNonNull(UserUtil.getLoginUser()).getUserId(); // String userName=UserUtil.getLoginUser().getUsername(); - vo.setInputUser(userId.toString()); +// vo.setInputUser(userId.toString()); String code=getCode(); vo.setCode(code); vo.setCreator(userId.toString()); @@ -282,4 +283,24 @@ public class PartInputServiceImpl implements PartInputService{ } return year+num; } + + /** + * 获取中文名 + * @param data + * @return + */ + @Override + public ServerResponse getUserName(UserPatypeInfo data) { + try{ + UserPatypeInfo vo=mapper.getUserName(data); + if(vo!=null){ + return ServerResponse.createSuccess(vo); + }else{ + return ServerResponse.createErroe("未找到该用户"); + } + }catch (Exception e){ + log.error(e.toString(),e); + } + return ServerResponse.createSuccess(new UserPatypeInfo()); + } } diff --git a/src/main/resources/mappers/bases/PartInputMapper.xml b/src/main/resources/mappers/bases/PartInputMapper.xml index 31c97db..6d6a89e 100644 --- a/src/main/resources/mappers/bases/PartInputMapper.xml +++ b/src/main/resources/mappers/bases/PartInputMapper.xml @@ -105,4 +105,10 @@ from t_part_put_details ppd where ppd.part_id=#{partId} + + \ No newline at end of file