From e98be9d02d12b0453c6267190b86fdbc11fee9fc Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期三, 28 五月 2025 12:38:49 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java | 13 +++++++------ /dev/null | 5 ----- rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/DeviceSiteServiceImpl.java | 2 -- rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java | 12 +++++------- rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java | 2 +- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/BasDeviceController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/BasDeviceController.java deleted file mode 100644 index 75b2717..0000000 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/BasDeviceController.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.vincent.rsf.server.manager.controller; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.vincent.rsf.framework.common.Cools; -import com.vincent.rsf.framework.common.R; -import com.vincent.rsf.server.common.utils.ExcelUtil; -import com.vincent.rsf.server.common.annotation.OperationLog; -import com.vincent.rsf.server.common.domain.BaseParam; -import com.vincent.rsf.server.common.domain.KeyValVo; -import com.vincent.rsf.server.common.domain.PageParam; -import com.vincent.rsf.server.manager.entity.BasDevice; -import com.vincent.rsf.server.manager.service.BasDeviceService; -import com.vincent.rsf.server.system.controller.BaseController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.*; - -@RestController -public class BasDeviceController extends BaseController { - - @Autowired - private BasDeviceService basDeviceService; - - @PreAuthorize("hasAuthority('manager:basDevice:list')") - @PostMapping("/basDevice/page") - public R page(@RequestBody Map<String, Object> map) { - BaseParam baseParam = buildParam(map, BaseParam.class); - PageParam<BasDevice, BaseParam> pageParam = new PageParam<>(baseParam, BasDevice.class); - return R.ok().add(basDeviceService.page(pageParam, pageParam.buildWrapper(true))); - } - - @PreAuthorize("hasAuthority('manager:basDevice:list')") - @PostMapping("/basDevice/list") - public R list(@RequestBody Map<String, Object> map) { - return R.ok().add(basDeviceService.list()); - } - - @PreAuthorize("hasAuthority('manager:basDevice:list')") - @PostMapping({"/basDevice/many/{ids}", "/basDevices/many/{ids}"}) - public R many(@PathVariable Long[] ids) { - return R.ok().add(basDeviceService.listByIds(Arrays.asList(ids))); - } - - @PreAuthorize("hasAuthority('manager:basDevice:list')") - @GetMapping("/basDevice/{id}") - public R get(@PathVariable("id") Long id) { - return R.ok().add(basDeviceService.getById(id)); - } - - @PreAuthorize("hasAuthority('manager:basDevice:save')") - @OperationLog("Create 鍩虹璁惧琛�") - @PostMapping("/basDevice/save") - public R save(@RequestBody BasDevice basDevice) { - basDevice.setCreateBy(getLoginUserId()); - basDevice.setCreateTime(new Date()); - basDevice.setUpdateBy(getLoginUserId()); - basDevice.setUpdateTime(new Date()); - if (!basDeviceService.save(basDevice)) { - return R.error("Save Fail"); - } - return R.ok("Save Success").add(basDevice); - } - - @PreAuthorize("hasAuthority('manager:basDevice:update')") - @OperationLog("Update 鍩虹璁惧琛�") - @PostMapping("/basDevice/update") - public R update(@RequestBody BasDevice basDevice) { - basDevice.setUpdateBy(getLoginUserId()); - basDevice.setUpdateTime(new Date()); - if (!basDeviceService.updateById(basDevice)) { - return R.error("Update Fail"); - } - return R.ok("Update Success").add(basDevice); - } - - @PreAuthorize("hasAuthority('manager:basDevice:remove')") - @OperationLog("Delete 鍩虹璁惧琛�") - @PostMapping("/basDevice/remove/{ids}") - public R remove(@PathVariable Long[] ids) { - if (!basDeviceService.removeByIds(Arrays.asList(ids))) { - return R.error("Delete Fail"); - } - return R.ok("Delete Success").add(ids); - } - - @PreAuthorize("hasAuthority('manager:basDevice:list')") - @PostMapping("/basDevice/query") - public R query(@RequestParam(required = false) String condition) { - List<KeyValVo> vos = new ArrayList<>(); - LambdaQueryWrapper<BasDevice> wrapper = new LambdaQueryWrapper<>(); - if (!Cools.isEmpty(condition)) { - wrapper.like(BasDevice::getId, condition); - } - basDeviceService.page(new Page<>(1, 30), wrapper).getRecords().forEach( - item -> vos.add(new KeyValVo(item.getId(), item.getId())) - ); - return R.ok().add(vos); - } - - @PreAuthorize("hasAuthority('manager:basDevice:list')") - @PostMapping("/basDevice/export") - public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { - ExcelUtil.build(ExcelUtil.create(basDeviceService.list(), BasDevice.class), response); - } - -} diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java index a96149c..59971b5 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java @@ -165,7 +165,7 @@ if (Objects.isNull(map.get("ids"))) { locs = locService.list(); } else { - locs = locService.list(new LambdaQueryWrapper<Loc>().in(Loc::getId , map.get("ids")).eq(Loc::getStatus, 1)); + locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getStatus, 1)); } ExcelUtil.build(ExcelUtil.create(locs, Loc.class), response); } diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/BasDevice.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/BasDevice.java deleted file mode 100644 index 5e8abdf..0000000 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/BasDevice.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.vincent.rsf.server.manager.entity; - -import java.text.SimpleDateFormat; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import com.vincent.rsf.framework.common.Cools; -import com.vincent.rsf.framework.common.SpringUtils; -import com.vincent.rsf.server.system.service.UserService; -import com.vincent.rsf.server.system.entity.User; -import java.io.Serializable; -import java.util.Date; - -@Data -@TableName("man_bas_device") -public class BasDevice implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * id - */ - @ApiModelProperty(value= "id") - @TableId(value = "id", type = IdType.AUTO) - private Long id; - - /** - * 璁惧鍙� - */ - @ApiModelProperty(value= "璁惧鍙�") - private Long deviceNo; - - /** - * 鍙叆 - */ - @ApiModelProperty(value= "鍙叆") - private String inEnable; - - /** - * 鍙嚭 - */ - @ApiModelProperty(value= "鍙嚭") - private String outEnable; - - /** - * 鐘舵�� - */ - @ApiModelProperty(value= "鐘舵��") - private String status; - - /** - * 婧愭暟鎹� - */ - @ApiModelProperty(value= "婧愭暟鎹�") - private String origin; - - @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄� 0: 鍚� ") - @TableLogic - private Integer deleted; - - /** - * 鍒涘缓浜� - */ - @ApiModelProperty(value= "鍒涘缓浜�") - private Long createBy; - - /** - * 鍒涘缓鏃堕棿 - */ - @ApiModelProperty(value= "鍒涘缓鏃堕棿") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") - private Date createTime; - - /** - * 鏇存柊浜� - */ - @ApiModelProperty(value= "鏇存柊浜�") - private Long updateBy; - - /** - * 鏇存柊鏃堕棿 - */ - @ApiModelProperty(value= "鏇存柊鏃堕棿") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") - private Date updateTime; - - /** - * 澶囨敞 - */ - @ApiModelProperty(value= "澶囨敞") - private String memo; - - public BasDevice() {} - - public BasDevice(Long deviceNo,String inEnable,String outEnable,String status,String origin,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { - this.deviceNo = deviceNo; - this.inEnable = inEnable; - this.outEnable = outEnable; - this.status = status; - this.origin = origin; - this.createBy = createBy; - this.createTime = createTime; - this.updateBy = updateBy; - this.updateTime = updateTime; - this.memo = memo; - } - -// BasDevice basDevice = new BasDevice( -// null, // 璁惧鍙� -// null, // 鍙叆 -// null, // 鍙嚭 -// null, // 鐘舵�� -// null, // 婧愭暟鎹� -// null, // 鍒涘缓浜� -// null, // 鍒涘缓鏃堕棿 -// null, // 鏇存柊浜� -// null, // 鏇存柊鏃堕棿 -// null // 澶囨敞 -// ); - - public String getCreateTime$(){ - if (Cools.isEmpty(this.createTime)){ - return ""; - } - return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); - } - - public String getUpdateTime$(){ - if (Cools.isEmpty(this.updateTime)){ - return ""; - } - return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); - } - - - -// public Boolean getStatusBool(){ -// if (null == this.status){ return null; } -// switch (this.status){ -// case "1": -// return true; -// case "0": -// return false; -// default: -// return null; -// } -// } - -} diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/mapper/BasDeviceMapper.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/mapper/BasDeviceMapper.java deleted file mode 100644 index 79395c5..0000000 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/mapper/BasDeviceMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.vincent.rsf.server.manager.mapper; - -import com.vincent.rsf.server.manager.entity.BasDevice; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -@Mapper -@Repository -public interface BasDeviceMapper extends BaseMapper<BasDevice> { - -} diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/BasDeviceService.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/BasDeviceService.java deleted file mode 100644 index 8779389..0000000 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/BasDeviceService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.vincent.rsf.server.manager.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.vincent.rsf.server.manager.entity.BasDevice; - -public interface BasDeviceService extends IService<BasDevice> { - -} diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/BasDeviceServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/BasDeviceServiceImpl.java deleted file mode 100644 index b4efdd1..0000000 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/BasDeviceServiceImpl.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.vincent.rsf.server.manager.service.impl; - -import com.vincent.rsf.server.manager.mapper.BasDeviceMapper; -import com.vincent.rsf.server.manager.entity.BasDevice; -import com.vincent.rsf.server.manager.service.BasDeviceService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -@Service("basDeviceService") -public class BasDeviceServiceImpl extends ServiceImpl<BasDeviceMapper, BasDevice> implements BasDeviceService { - -} diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/DeviceSiteServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/DeviceSiteServiceImpl.java index b49ac55..467a9e9 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/DeviceSiteServiceImpl.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/DeviceSiteServiceImpl.java @@ -1,10 +1,8 @@ package com.vincent.rsf.server.manager.service.impl; -import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.manager.controller.params.DeviceSiteParame; -import com.vincent.rsf.server.manager.entity.BasDevice; import com.vincent.rsf.server.manager.entity.BasStation; import com.vincent.rsf.server.manager.mapper.DeviceSiteMapper; import com.vincent.rsf.server.manager.entity.DeviceSite; diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java index 341ec5b..fa3234f 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java @@ -582,11 +582,9 @@ throw new CoolException("鏇存柊缁勬墭鐘舵�佸け璐ワ紒锛�"); } } - Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTaskType() < TaskStsType.UPDATED_IN.id ? task.getTargLoc() : task.getOrgLoc())); - if (null != loc - && (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) - || loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type))) { + Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTaskType() < TaskStsType.UPDATED_IN.id ? task.getTargLoc() : task.getOrgLoc())); + if (null != loc && (loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type))) { loc.setUseStatus(LocStsType.LOC_STS_TYPE_O.type); if (!locService.updateById(loc)) { throw new CoolException("鏇存柊搴撲綅鐘舵�佸け璐ワ紒锛�"); @@ -607,8 +605,7 @@ ) { basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() .eq(BasStation::getStationName, task.getTargLoc()) - .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type) - ); + .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type)); } if (null == basStation) { throw new CoolException("绔欑偣鐘舵�侀敊璇紒锛�"); @@ -618,6 +615,10 @@ throw new CoolException("鏇存柊绔欑偣鐘舵�佸け璐ワ紒锛�"); } } + + if (!taskItemService.remove(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()))) { + throw new CoolException("浠诲姟鏄庣粏鍒犻櫎澶辫触锛侊紒"); + } } if (!this.removeByIds(Arrays.asList(ids))) { throw new CoolException("Delete Fail"); diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java index 1d8d4f1..a554d1c 100644 --- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java +++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java @@ -149,7 +149,7 @@ } - double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); + Double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); if (!waitPakinItemService.saveBatch(items)) { throw new CoolException("缁勬墭鏄庣粏淇濆瓨澶辫触锛侊紒"); @@ -161,9 +161,10 @@ if (Objects.isNull(one)) { throw new CoolException("鏀惰揣鍖烘暟鎹敊璇紒锛�"); } -// one.setAnfme(one.getAnfme() - pakinItem.getAnfme()) - one.setWorkQty(one.getWorkQty() + pakinItem.getAnfme() + one.getQty()); - if (one.getWorkQty() > one.getAnfme()) { + Double workQty = Math.round((one.getWorkQty() + pakinItem.getAnfme()) * 10000) / 10000.0; + Double qty = Math.round((workQty + one.getQty()) * 10000) / 10000.0; + one.setWorkQty(workQty); + if (qty.compareTo(one.getAnfme()) > 0) { throw new CoolException("缁勬墭鏁伴噺涓嶈兘澶т簬鏀惰揣鏁伴噺锛侊紒"); } if (!warehouseAreasItemService.saveOrUpdate(one)) { @@ -175,9 +176,6 @@ if (!this.updateById(waitPakin1)) { throw new CoolException("缁勬墭鏁伴噺淇敼澶辫触锛侊紒"); } - - //TODO 缁勬墭瀹屾垚鍚庯紝鎵e噺鏀惰揣鍖哄簱瀛� - return pakin; } diff --git a/rsf-server/src/main/resources/mapper/manager/BasDeviceMapper.xml b/rsf-server/src/main/resources/mapper/manager/BasDeviceMapper.xml deleted file mode 100644 index 7ac5f0d..0000000 --- a/rsf-server/src/main/resources/mapper/manager/BasDeviceMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.vincent.rsf.server.manager.mapper.BasDeviceMapper"> - -</mapper> -- Gitblit v1.9.1