value
2024-04-07 ba7168283fadf8e13761de353c51998fee09bd81
新增仓库删除和仓库修改;修复检验保存功能
已修改6个文件
87 ■■■■■ 文件已修改
inspect-server/src/main/java/com/yuanchu/mom/controller/WarehouseController.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/mapper/WarehouseCellMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/WarehouseService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/WarehouseServiceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsSampleMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/WarehouseController.java
@@ -1,14 +1,15 @@
package com.yuanchu.mom.controller;
import com.yuanchu.mom.pojo.Warehouse;
import com.yuanchu.mom.pojo.WarehouseShelf;
import com.yuanchu.mom.service.WarehouseService;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@RequestMapping("/warehouse")
@RestController
@@ -30,4 +31,28 @@
        return Result.success(warehouseService.selectWarehouse());
    }
    @PostMapping("/addShelf")
    @ApiOperation("添加货架")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "name", name = "名称"),
            @ApiImplicitParam(value = "row", name = "行"),
            @ApiImplicitParam(value = "col", name = "列"),
            @ApiImplicitParam(value = "warehouseId", name = "仓库id")
    })
    public Result addShelf(@RequestBody WarehouseShelf warehouseShelf) {
        return Result.success(warehouseService.addShelf(warehouseShelf));
    }
    @PostMapping("/delWarehouse")
    @ApiOperation("删除仓库")
    public Result delWarehouse(Integer id) {
        return Result.success(warehouseService.delWarehouse(id));
    }
    @PostMapping("/upWarehouse")
    @ApiOperation("修改仓库")
    public Result upWarehouse(@RequestBody Warehouse warehouse) {
        return Result.success(warehouseService.upWarehouse(warehouse));
    }
}
inspect-server/src/main/java/com/yuanchu/mom/mapper/WarehouseCellMapper.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.mapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.mom.pojo.WarehouseCell;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -9,7 +10,7 @@
* @createDate 2024-04-06 12:12:12
* @Entity com.yuanchu.mom.pojo.WarehouseCell
*/
public interface WarehouseCellMapper extends BaseMapper<WarehouseCell> {
public interface WarehouseCellMapper extends IService<WarehouseCell> {
}
inspect-server/src/main/java/com/yuanchu/mom/service/WarehouseService.java
@@ -3,6 +3,7 @@
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;
@@ -16,4 +17,10 @@
    int addWarehouse(String name);
    List<WarehouseDto> selectWarehouse();
    int addShelf(WarehouseShelf warehouseShelf);
    int delWarehouse(Integer id);
    int upWarehouse(Warehouse warehouse);
}
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -76,6 +76,7 @@
    @Resource
    private InsReportMapper insReportMapper;
    @Resource
    private InsProductResultMapper insProductResultMapper;
    @Override
@@ -190,7 +191,7 @@
                    JSONObject insValue = JSON.parseObject(JSON.toJSONString(o));
                    Map<String, Object> map = new HashMap<>();
                    map.put("v", JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v"));
                    if (insValue.get("u") == null && StrUtil.isNotEmpty(JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v").toString())) {
                    if ((insValue.get("u") == null || insValue.get("u").equals("")) && StrUtil.isNotEmpty(JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v").toString())) {
                        map.put("u", userId);
                    }else {
                        map.put("u", insValue.get("u"));
inspect-server/src/main/java/com/yuanchu/mom/service/impl/WarehouseServiceImpl.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.dto.WarehouseDto;
import com.yuanchu.mom.mapper.WarehouseCellMapper;
@@ -7,11 +8,15 @@
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.service.WarehouseService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
@@ -43,6 +48,36 @@
    public List<WarehouseDto> selectWarehouse() {
        return warehouseMapper.selectWarehouseList();
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    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++) {
                WarehouseCell cell = new WarehouseCell();
                cell.setRow(i);
                cell.setCol(a);
                cell.setState(1);
                cells.add(cell);
            }
        }
        warehouseCellMapper.saveBatch(cells);
        return 1;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int delWarehouse(Integer id) {
        warehouseShelfMapper.delete(Wrappers.<WarehouseShelf>lambdaUpdate().eq(WarehouseShelf::getWarehouseId, id));
        return warehouseMapper.deleteById(id);
    }
    @Override
    public int upWarehouse(Warehouse warehouse) {
        return warehouseMapper.updateById(warehouse);
    }
}
inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -145,9 +145,13 @@
               ip.update_user ip_update_user,
               ip.create_time ip_create_time,
               ip.update_time ip_update_time,
               template_id
               template_id,
               ipr.ins_value,
               ipr.com_value,
               ipr.equip_value
        from ins_sample isa
        left join ins_product ip on isa.id = ip.ins_sample_id
        left join ins_product_result ipr on ip.id = ipr.ins_product_id
        where ins_order_id = #{id}
        and state = 1
        and ip.son_laboratory = #{laboratory}