cnas-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java
@@ -121,7 +121,7 @@ @PostMapping("/selectDeviceByCategory") @ValueAuth @ApiImplicitParams({ @ApiImplicitParam(name = "category", value = "设å¤åç±»"), @ApiImplicitParam(name = "category", value = "设å¤åç±»", dataTypeClass = String.class), }) public Result selectDeviceByCategory(String category) { return Result.success(deviceService.selectDeviceByCategory(category)); inspect-server/src/main/java/com/yuanchu/mom/controller/InsOrderController.java
@@ -79,8 +79,8 @@ @ApiOperation(value = "å®¡æ ¸æ£éªåè¿è¡ç¶æä¿®æ¹") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "æ£éªåid"), @ApiImplicitParam(name = "state", value = "å®¡æ ¸ç»æ 1:éè¿ 2ï¼ä¸éè¿") @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class), @ApiImplicitParam(name = "state", value = "å®¡æ ¸ç»æ 1:éè¿ 2ï¼ä¸éè¿", dataTypeClass = Integer.class) }) @PostMapping("/upInsOrderOfState") public Result<?> upInsOrderOfState(@RequestBody InsOrder insOrder) { inspect-server/src/main/java/com/yuanchu/mom/controller/WarehouseController.java
@@ -1,5 +1,6 @@ package com.yuanchu.mom.controller; import com.yuanchu.mom.annotation.ValueAuth; import com.yuanchu.mom.pojo.Warehouse; import com.yuanchu.mom.pojo.WarehouseShelf; import com.yuanchu.mom.service.WarehouseService; @@ -34,10 +35,10 @@ @PostMapping("/addShelf") @ApiOperation("æ·»å è´§æ¶") @ApiImplicitParams({ @ApiImplicitParam(value = "name", name = "åç§°"), @ApiImplicitParam(value = "row", name = "è¡"), @ApiImplicitParam(value = "col", name = "å"), @ApiImplicitParam(value = "warehouseId", name = "ä»åºid") @ApiImplicitParam(value = "name", name = "åç§°", dataTypeClass = String.class), @ApiImplicitParam(value = "row", name = "è¡", dataTypeClass = Integer.class), @ApiImplicitParam(value = "col", name = "å", dataTypeClass = Integer.class), @ApiImplicitParam(value = "warehouseId", name = "ä»åºid", dataTypeClass = Integer.class) }) public Result addShelf(@RequestBody WarehouseShelf warehouseShelf) { return Result.success(warehouseService.addShelf(warehouseShelf)); @@ -55,4 +56,47 @@ return Result.success(warehouseService.upWarehouse(warehouse)); } @PostMapping("/delShelf") @ApiOperation("å é¤è´§æ¶") public Result delShelf(Integer id) { return Result.success(warehouseService.delShelf(id)); } @PostMapping("/upShelf") @ApiOperation("ä¿®æ¹è´§æ¶") public Result upShelf(@RequestBody WarehouseShelf warehouseShelf) { return Result.success(warehouseService.upShelf(warehouseShelf)); } @GetMapping("/getWarehouse") @ApiOperation("æ¥è¯¢è´§æ¶ä¸çåæ¾ä¿¡æ¯") @ValueAuth public Result getWarehouse(Integer shelfId) { return Result.success(warehouseService.getWarehouse(shelfId)); } @PostMapping("/inWarehouse") @ApiOperation("æ ·åå ¥åº") public Result inWarehouse(String trees, String sampleCode) { return Result.success(warehouseService.inWarehouse(trees, sampleCode)); } @PostMapping("/outWarehouse") @ApiOperation("æ ·ååºåº") public Result outWarehouse(String sampleCode) { return Result.success(warehouseService.outWarehouse(sampleCode)); } @PostMapping("/getSampleRecord") @ApiOperation("æ¥è¯¢æ ·å详ç»è®°å½") public Result getSampleRecord(Integer id) { return Result.success(warehouseService.getSampleRecord(id)); } @PostMapping("/searchSampleId") @ApiOperation("éè¿æ ·åç¼å·è¿è¡æ£ç´¢") public Result searchSampleId(String sampleCode) { return Result.success(warehouseService.searchSampleId(sampleCode)); } } inspect-server/src/main/java/com/yuanchu/mom/dto/HistoryDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ package com.yuanchu.mom.dto; import com.yuanchu.mom.pojo.WarehouseHistory; import lombok.Data; @Data public class HistoryDto extends WarehouseHistory { private String createUserName; private String warehouseCode; } inspect-server/src/main/java/com/yuanchu/mom/dto/ProductResultDto2.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,19 @@ package com.yuanchu.mom.dto; import com.yuanchu.mom.pojo.InsProduct; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data public class ProductResultDto2 extends InsProduct { @ApiModelProperty("æ£éªè®¾å¤") private String equipValue; @ApiModelProperty("æ£éªäºº") private String updateUserName; @ApiModelProperty("å§æç¼å·") private String entrustCode; } inspect-server/src/main/java/com/yuanchu/mom/dto/WarehouseCellAndSampleDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ package com.yuanchu.mom.dto; import com.yuanchu.mom.pojo.InsSample; import com.yuanchu.mom.pojo.WarehouseCell; import lombok.Data; import java.util.List; @Data public class WarehouseCellAndSampleDto extends WarehouseCell { private List<InsSample> samples; } inspect-server/src/main/java/com/yuanchu/mom/dto/WarehouseHistoryDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ package com.yuanchu.mom.dto; import com.yuanchu.mom.pojo.InsSample; import com.yuanchu.mom.pojo.WarehouseHistory; import lombok.Data; import java.util.List; @Data public class WarehouseHistoryDto extends WarehouseHistory { List<InsSample> insSamples; } inspect-server/src/main/java/com/yuanchu/mom/mapper/InsProductMapper.java
@@ -1,8 +1,10 @@ package com.yuanchu.mom.mapper; import com.yuanchu.mom.dto.ProductResultDto2; import com.yuanchu.mom.pojo.InsProduct; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import java.util.List; import java.util.Map; /** @@ -17,6 +19,8 @@ Map<String, String> selectUserById(Integer userId); List<ProductResultDto2> getProductAndResult(Integer sampleId); } inspect-server/src/main/java/com/yuanchu/mom/mapper/WarehouseCellMapper.java
@@ -1,8 +1,10 @@ package com.yuanchu.mom.mapper; import com.baomidou.mybatisplus.extension.service.IService; import com.yuanchu.mom.dto.WarehouseCellAndSampleDto; import com.yuanchu.mom.pojo.WarehouseCell; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import java.util.List; /** * @author z1292 @@ -10,7 +12,9 @@ * @createDate 2024-04-06 12:12:12 * @Entity com.yuanchu.mom.pojo.WarehouseCell */ public interface WarehouseCellMapper extends IService<WarehouseCell> { public interface WarehouseCellMapper extends BaseMapper<WarehouseCell> { List<WarehouseCellAndSampleDto> getWarehouse(Integer shelfId); } inspect-server/src/main/java/com/yuanchu/mom/mapper/WarehouseHistoryMapper.java
@@ -1,7 +1,10 @@ package com.yuanchu.mom.mapper; import com.yuanchu.mom.dto.HistoryDto; import com.yuanchu.mom.pojo.WarehouseHistory; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import java.util.List; /** * @author z1292 @@ -11,6 +14,10 @@ */ public interface WarehouseHistoryMapper extends BaseMapper<WarehouseHistory> { String getUserNameById(Integer userId); List<HistoryDto> getHistoryListBySampleId(Integer sampleId); } inspect-server/src/main/java/com/yuanchu/mom/pojo/InsSample.java
@@ -99,6 +99,8 @@ @ApiModelProperty("æ ·ååä½") private String unit; private Integer cellId; @TableField(fill = FieldFill.INSERT) private Integer createUser; inspect-server/src/main/java/com/yuanchu/mom/pojo/WarehouseHistory.java
@@ -22,6 +22,8 @@ @TableId(type = IdType.AUTO) private Integer id; private String warehouseCode; /** * å¤é®ï¼æ ·åid */ inspect-server/src/main/java/com/yuanchu/mom/service/WarehouseCellService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ package com.yuanchu.mom.service; import com.baomidou.mybatisplus.extension.service.IService; import com.yuanchu.mom.pojo.WarehouseCell; /** * @author z1292 * @description é对表ãwarehouse(ä»åº)ãçæ°æ®åºæä½Service * @createDate 2024-04-06 12:13:57 */ public interface WarehouseCellService extends IService<WarehouseCell> { } inspect-server/src/main/java/com/yuanchu/mom/service/WarehouseService.java
@@ -1,11 +1,13 @@ package com.yuanchu.mom.service; import com.yuanchu.mom.dto.WarehouseCellAndSampleDto; import com.yuanchu.mom.dto.WarehouseDto; import com.yuanchu.mom.pojo.Warehouse; import com.baomidou.mybatisplus.extension.service.IService; import com.yuanchu.mom.pojo.WarehouseShelf; import java.util.List; import java.util.Map; /** * @author z1292 @@ -23,4 +25,18 @@ int delWarehouse(Integer id); int upWarehouse(Warehouse warehouse); int delShelf(Integer id); int upShelf(WarehouseShelf warehouseShelf); List<WarehouseCellAndSampleDto> getWarehouse(Integer shelfId); int inWarehouse(String trees, String sampleCode); int outWarehouse(String sampleCode); Map<String, Object> getSampleRecord(Integer id); int searchSampleId(String sampleCode); } inspect-server/src/main/java/com/yuanchu/mom/service/impl/WarehouseCellServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,26 @@ package com.yuanchu.mom.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yuanchu.mom.mapper.WarehouseCellMapper; import com.yuanchu.mom.pojo.WarehouseCell; import com.yuanchu.mom.service.WarehouseCellService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; /** * @author Administrator * @description é对表ãins_sample_user(æ ·åè´è´£äººè®°å½)ãçæ°æ®åºæä½Serviceå®ç° * @createDate 2024-03-14 17:12:02 */ @Service @AllArgsConstructor public class WarehouseCellServiceImpl extends ServiceImpl<WarehouseCellMapper, WarehouseCell> implements WarehouseCellService { } inspect-server/src/main/java/com/yuanchu/mom/service/impl/WarehouseServiceImpl.java
@@ -2,22 +2,24 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yuanchu.mom.dto.HistoryDto; import com.yuanchu.mom.dto.WarehouseCellAndSampleDto; import com.yuanchu.mom.dto.WarehouseDto; import com.yuanchu.mom.mapper.WarehouseCellMapper; import com.yuanchu.mom.mapper.WarehouseHistoryMapper; import com.yuanchu.mom.mapper.WarehouseMapper; import com.yuanchu.mom.mapper.WarehouseShelfMapper; import com.yuanchu.mom.pojo.Warehouse; import com.yuanchu.mom.pojo.WarehouseCell; import com.yuanchu.mom.pojo.WarehouseHistory; import com.yuanchu.mom.pojo.WarehouseShelf; import com.yuanchu.mom.exception.ErrorException; import com.yuanchu.mom.mapper.*; import com.yuanchu.mom.pojo.*; import com.yuanchu.mom.service.WarehouseCellService; import com.yuanchu.mom.service.WarehouseService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Administrator @@ -37,6 +39,12 @@ private WarehouseHistoryMapper warehouseHistoryMapper; private WarehouseCellService warehouseCellService; private InsSampleMapper insSampleMapper; private InsProductMapper insProductMapper; @Override public int addWarehouse(String name) { Warehouse warehouse = new Warehouse(); @@ -54,16 +62,17 @@ public int addShelf(WarehouseShelf warehouseShelf) { warehouseShelfMapper.insert(warehouseShelf); List<WarehouseCell> cells = new ArrayList<>(); for (Integer i = 0; i < warehouseShelf.getRow(); i++) { for (Integer a = 0; a < warehouseShelf.getCol(); a++) { for (int i = 1; i < warehouseShelf.getRow() + 1; i++) { for (int a = 1; a < warehouseShelf.getCol() + 1; a++) { WarehouseCell cell = new WarehouseCell(); cell.setRow(i); cell.setCol(a); cell.setState(1); cell.setShelfId(warehouseShelf.getId()); cells.add(cell); } } warehouseCellMapper.saveBatch(cells); warehouseCellService.saveBatch(cells); return 1; } @@ -78,6 +87,102 @@ public int upWarehouse(Warehouse warehouse) { return warehouseMapper.updateById(warehouse); } @Override @Transactional(rollbackFor = Exception.class) public int delShelf(Integer id) { warehouseCellMapper.update(null ,Wrappers.<WarehouseCell>lambdaUpdate().eq(WarehouseCell::getShelfId, id).set(WarehouseCell::getState, 0)); return warehouseShelfMapper.deleteById(id); } @Override @Transactional(rollbackFor = Exception.class) public int upShelf(WarehouseShelf warehouseShelf) { warehouseCellMapper.update(null, Wrappers.<WarehouseCell>lambdaUpdate() .eq(WarehouseCell::getShelfId, warehouseShelf.getWarehouseId()) .gt(WarehouseCell::getRow, warehouseShelf.getRow()) .gt(WarehouseCell::getCol, warehouseShelf.getCol()) .set(WarehouseCell::getState, 0)); warehouseShelfMapper.updateById(warehouseShelf); return 0; } @Override public List<WarehouseCellAndSampleDto> getWarehouse(Integer shelfId) { return warehouseCellMapper.getWarehouse(shelfId); } @Override public int inWarehouse(String trees, String sampleCode) { String[] tree = trees.split("-"); if(tree.length < 4){ throw new ErrorException("åºä½éæ©é误"); } List<InsSample> samples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getSampleCode, sampleCode).select(InsSample::getId,InsSample::getCellId)); if(samples.size()!=1){ throw new ErrorException("æ ·åç¼å·è¾å ¥æè¯¯"); } if(samples.get(0).getCellId()!=null){ throw new ErrorException("æ ·å " + sampleCode + " æªåºåº"); } WarehouseCell cell = warehouseCellMapper.selectOne(Wrappers.<WarehouseCell>lambdaQuery().eq(WarehouseCell::getShelfId, tree[1]).eq(WarehouseCell::getRow, tree[2]).eq(WarehouseCell::getCol, tree[3]).eq(WarehouseCell::getState, 1).select(WarehouseCell::getId,WarehouseCell::getRow,WarehouseCell::getCol)); WarehouseShelf shelf = warehouseShelfMapper.selectById(tree[1]); Warehouse warehouse = warehouseMapper.selectById(tree[0]); WarehouseHistory history = new WarehouseHistory(); history.setCellId(cell.getId()); history.setState(1); history.setInsSampleId(samples.get(0).getId()); history.setWarehouseCode(warehouse.getName()+"-"+shelf.getName()+"-"+cell.getRow()+"-"+cell.getCol()); samples.get(0).setCellId(cell.getId()); insSampleMapper.updateById(samples.get(0)); return warehouseHistoryMapper.insert(history); } @Override public int outWarehouse(String sampleCode) { List<InsSample> samples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getSampleCode, sampleCode).select(InsSample::getId,InsSample::getCellId)); if(samples.size()!=1){ throw new ErrorException("æ ·åç¼å·è¾å ¥æè¯¯"); } if(samples.get(0).getCellId()==null){ throw new ErrorException("æ ·å " + sampleCode + " æªå ¥åº"); } WarehouseHistory history = new WarehouseHistory(); history.setState(2); history.setInsSampleId(samples.get(0).getId()); history.setCellId(samples.get(0).getCellId()); history.setWarehouseCode(warehouseHistoryMapper.selectOne(Wrappers.<WarehouseHistory>lambdaQuery().eq(WarehouseHistory::getInsSampleId, samples.get(0).getId()).select(WarehouseHistory::getWarehouseCode).orderByDesc(WarehouseHistory::getId).last("limit 1")).getWarehouseCode()); insSampleMapper.update(null, Wrappers.<InsSample>lambdaUpdate().eq(InsSample::getId, samples.get(0).getId()).set(InsSample::getCellId, null)); return warehouseHistoryMapper.insert(history); } @Override public Map<String, Object> getSampleRecord(Integer id) { InsSample insSample = insSampleMapper.selectById(id); List<HistoryDto> histories = warehouseHistoryMapper.getHistoryListBySampleId(id); Map<String, Object> map = new HashMap<>(); Map<String, String> sampleHistory = new HashMap<>(); WarehouseHistory history = histories.get(histories.size() - 1); if(history.getState() == 1){ sampleHistory.put("date", history.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); sampleHistory.put("user", warehouseHistoryMapper.getUserNameById(history.getCreateUser())); sampleHistory.put("code", history.getWarehouseCode()); } map.put("sampleHistory", sampleHistory); map.put("insSample", insSample); map.put("histories", histories); map.put("products", insProductMapper.getProductAndResult(id)); return map; } @Override public int searchSampleId(String sampleCode) { List<InsSample> samples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getSampleCode, sampleCode).select(InsSample::getId)); if(samples.size()!=1){ throw new ErrorException("æ ·åç¼å·è¾å ¥æè¯¯"); } return samples.get(0).getId(); } } inspect-server/src/main/resources/mapper/InsProductMapper.xml
@@ -49,4 +49,14 @@ <select id="selectUserById" resultType="java.util.Map"> select name,company,phone,address from user where id = #{userId} </select> <select id="getProductAndResult" resultType="com.yuanchu.mom.dto.ProductResultDto2"> select ip.id,ip.inspection_item,ip.inspection_item_subclass,ip.laboratory,ip.unit,ipr.equip_value,io.entrust_code,ipr.update_time,ip.ins_result,u.name updateUserName from ins_product ip left join ins_product_result ipr on ip.id = ipr.ins_product_id left join ins_sample isa on isa.id = ip.ins_sample_id left join ins_order io on io.id = isa.ins_order_id left join user u on u.id = ipr.update_user where ip.ins_sample_id = #{sampleId} and ip.ins_result is not null </select> </mapper> inspect-server/src/main/resources/mapper/WarehouseCellMapper.xml
@@ -5,20 +5,36 @@ <mapper namespace="com.yuanchu.mom.mapper.WarehouseCellMapper"> <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.WarehouseCell"> <id property="id" column="id" jdbcType="INTEGER"/> <result property="row" column="row" jdbcType="INTEGER"/> <result property="col" column="col" jdbcType="INTEGER"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> <result property="createUser" column="create_user" jdbcType="INTEGER"/> <result property="updateUser" column="update_user" jdbcType="INTEGER"/> <result property="state" column="state" jdbcType="INTEGER"/> <result property="shelfId" column="shelf_id" jdbcType="INTEGER"/> <id property="id" column="id" jdbcType="INTEGER"/> <result property="row" column="row" jdbcType="INTEGER"/> <result property="col" column="col" jdbcType="INTEGER"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> <result property="createUser" column="create_user" jdbcType="INTEGER"/> <result property="updateUser" column="update_user" jdbcType="INTEGER"/> <result property="state" column="state" jdbcType="INTEGER"/> <result property="shelfId" column="shelf_id" jdbcType="INTEGER"/> </resultMap> <sql id="Base_Column_List"> id,row,col, create_time,update_time,create_user, update_user,state,shelf_id </sql> <select id="getWarehouse" resultMap="WarehouseCellAndHistoryDto"> select wc.id, wc.row, wc.col, i.id sampleId, i.sample, i.model, i.sample_code from warehouse_cell wc left join ins_sample i on i.cell_id = wc.id where wc.state = 1 and wc.shelf_id = #{shelfId} order by wc.id </select> <resultMap id="WarehouseCellAndHistoryDto" type="com.yuanchu.mom.dto.WarehouseCellAndSampleDto"> <id property="id" column="id" jdbcType="INTEGER"/> <result property="row" column="row" jdbcType="INTEGER"/> <result property="col" column="col" jdbcType="INTEGER"/> <collection property="samples" resultMap="InsSample"/> </resultMap> <resultMap id="InsSample" type="com.yuanchu.mom.pojo.InsSample"> <id property="id" column="sampleId"/> <result property="sample" column="sample"/> <result property="model" column="model"/> <result property="sampleCode" column="sample_code"/> </resultMap> </mapper> inspect-server/src/main/resources/mapper/WarehouseHistoryMapper.xml
@@ -15,9 +15,13 @@ <result property="cellId" column="cell_id" jdbcType="INTEGER"/> </resultMap> <sql id="Base_Column_List"> id,ins_sample_id,state, create_time,update_time,create_user, update_user,cell_id </sql> <select id="getUserNameById" resultType="java.lang.String"> select name from user where id = #{userId} </select> <select id="getHistoryListBySampleId" resultType="com.yuanchu.mom.dto.HistoryDto"> select wh.*,u.name createUserName from warehouse_history wh left join user u on u.id = wh.create_user where wh.ins_sample_id = #{sampleId} order by wh.id desc </select> </mapper> other-jar/e-iceblue/spire.doc.free/5.2.0/spire.doc.free-5.2.0.jarBinary files differ
other-jar/e-iceblue/spire.doc.free/5.2.0/spire.doc.free-5.2.0.jar.lastUpdated
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,4 @@ #NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice. #Sat Apr 06 17:46:20 CST 2024 http\://maven.aliyun.com/nexus/content/groups/public/.error= http\://maven.aliyun.com/nexus/content/groups/public/.lastUpdated=1712396780448 other-jar/e-iceblue/spire.doc.free/5.2.0/spire.doc.free-5.2.0.pom
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,9 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>e-iceblue</groupId> <artifactId>spire.doc.free</artifactId> <version>5.2.0</version> </project> other-jar/e-iceblue/spire.doc.free/5.2.0/spire.doc.free-5.2.0.pom.lastUpdated
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,4 @@ #NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice. #Sat Apr 06 17:45:57 CST 2024 http\://maven.aliyun.com/nexus/content/groups/public/.error= http\://maven.aliyun.com/nexus/content/groups/public/.lastUpdated=1712396757428 system-run/src/main/resources/application-dev.yml
@@ -5,12 +5,12 @@ logging: config: classpath:logback-spring.xml # æ¥å¿åå¨è·¯å¾+++++++++++++++++++++++++++è¿ç»´éè¦é ç½®+++++++++++++++++++++++++++ file-location: D:\é¹éå ¬å¸\frame-after\logs file-location: D:\Download\log # æ°æ®åºå¤ä»½è·¯å¾ backup: # æ°æ®åºå¤ä»½è·¯å¾+++++++++++++++++++++++++++è¿ç»´éè¦é ç½®+++++++++++++++++++++++++++ path: D:\é¹éå ¬å¸\frame-after path: D:\Download\log # æ°æ®åºå¤ä»½å¤©æ° destiny: 7 # æ°æ®åºå¤ä»½å·¥å ·è·¯å¾+++++++++++++++++++++++++++è¿ç»´éè¦é ç½®+++++++++++++++++++++++++++ @@ -18,11 +18,11 @@ # ç §çåå¨è·¯å¾+++++++++++++++++++++++++++è¿ç»´éè¦é ç½®+++++++++++++++++++++++++++ file: path: D:\é¡¹ç®æä»¶åå¨\image path: D:\Download # ä¸ä¼ æä»¶å è®¸çæ©å±å allowed: png,jpg,jpeg,gif wordUrl: D:\é¡¹ç®æä»¶åå¨\word wordUrl: D:\Download mybatis-plus: type-aliases-package: com.yuanchu.mom.pojo user-server/src/main/java/com/yuanchu/mom/controller/UserController.java
@@ -161,4 +161,11 @@ public Result<?> getUserInfo(){ return Result.success(userService.getUserInfo()); } @PostMapping("/upUserPassword") @ApiOperation(value = "ä¿®æ¹ç¨æ·å¯ç ") @ValueAuth public Result<?> upUserPassword(String oldPassword, String newPassWord){ return Result.success(userService.upUserPassword(oldPassword, newPassWord)); } } user-server/src/main/java/com/yuanchu/mom/service/UserService.java
@@ -30,4 +30,6 @@ User getUserInfo(); int upUserPassword(String oldPassword, String newPassWord); } user-server/src/main/java/com/yuanchu/mom/service/impl/UserServiceImp.java
@@ -1,11 +1,13 @@ package com.yuanchu.mom.service.impl; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.yuanchu.mom.common.GetLook; import com.yuanchu.mom.common.PrintChina; import com.yuanchu.mom.dto.UserPageDto; import com.yuanchu.mom.exception.ErrorException; import com.yuanchu.mom.mapper.UserMapper; import com.yuanchu.mom.pojo.User; import com.yuanchu.mom.service.UserService; @@ -86,4 +88,15 @@ Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); return userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getId, map1.get("userId")).select(User::getId,User::getCompany,User::getName,User::getCode)); } @Override public int upUserPassword(String oldPassword, String newPassWord) { Map<String, Integer> map = getLook.selectPowerByMethodAndUserId(null); User user = userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getId, map.get("userId")).eq(User::getPassword, DigestUtils.md5DigestAsHex(oldPassword.getBytes())).select(User::getId)); if(BeanUtil.isEmpty(user)){ throw new ErrorException("å¯ç 䏿£ç¡®"); } user.setPassword(DigestUtils.md5DigestAsHex(newPassWord.getBytes())); return userMapper.updateById(user); } }