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 3848aeb..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; @@ -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/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/bases/PartInputMapper.xml b/src/main/resources/mappers/bases/PartInputMapper.xml index e0c8bc5..53059c7 100644 --- a/src/main/resources/mappers/bases/PartInputMapper.xml +++ b/src/main/resources/mappers/bases/PartInputMapper.xml @@ -123,4 +123,10 @@ from t_part_put_details ppd where ppd.part_id=#{partId} + + \ No newline at end of file