no message
parent
0b81b55e59
commit
c579cab7dd
|
|
@ -12,9 +12,12 @@ import java.net.URLDecoder;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.cpte.modules.base.entity.Area;
|
||||
import org.cpte.modules.base.service.IAreaService;
|
||||
import org.cpte.modules.constant.enums.AreaTypeEnum;
|
||||
import org.cpte.modules.constant.enums.CommonStatusEnum;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.cpte.modules.base.entity.Point;
|
||||
|
|
@ -26,6 +29,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -195,4 +199,21 @@ public class PointController extends JeecgController<Point, IPointService> {
|
|||
return super.importExcel(request, response, Point.class);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询出库工作站")
|
||||
@GetMapping(value = "/queryOutWorkStation")
|
||||
public Result<List<String>> queryOutWorkStation(@RequestParam(name = "areaId_dictText", required = true) String areaId_dictText) {
|
||||
String areaCode="";
|
||||
if(AreaTypeEnum.CPCCQ.getDesc().equals(areaId_dictText)){
|
||||
areaCode=AreaTypeEnum.CK_DOCK.getValue();
|
||||
}else{
|
||||
areaCode=AreaTypeEnum.MJCK_DOCK.getValue();
|
||||
}
|
||||
List<Point> points = pointService.queryPoints(null, CommonStatusEnum.FREE.getValue(), areaCode);
|
||||
if (CollectionUtils.isEmpty(points)) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
List<String> pointCodes = points.stream().map(Point::getPointCode).collect(Collectors.toList());
|
||||
return Result.OK(pointCodes);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,4 +308,15 @@ public class CountPlanController {
|
|||
return Result.OK("文件导入失败!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "盘点-任务下发")
|
||||
@Operation(summary = "盘点-任务下发")
|
||||
@RequiresPermissions("count:data_count_plan:countIssueTask")
|
||||
@GetMapping(value = "/countIssueTask")
|
||||
public Result<String> countIssueTask(@RequestParam(name = "workStations", required = true) List<String> workStations) {
|
||||
for (String workStation : workStations){
|
||||
log.info("任务下发中,工作台:{}", workStation);
|
||||
}
|
||||
return Result.OK("任务下发成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,6 @@ public class CountPlanServiceImpl extends ServiceImpl<CountPlanMapper, CountPlan
|
|||
private void processInventory(CountPlan countPlan, List<Inventory> inventories) {
|
||||
|
||||
List<CountDetail> countDetails = new ArrayList<>();
|
||||
List<Inventory> inventoriesToUpdate = new ArrayList<>();
|
||||
|
||||
for (Inventory inventory : inventories) {
|
||||
// 创建盘点明细
|
||||
|
|
@ -180,14 +179,13 @@ public class CountPlanServiceImpl extends ServiceImpl<CountPlanMapper, CountPlan
|
|||
|
||||
// 更新库存状态
|
||||
inventory.setStatus(InventoryStatusEnum.COUNTING.getValue());
|
||||
inventoriesToUpdate.add(inventory);
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(countDetails)) {
|
||||
countDetailMapper.insert(countDetails);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(inventoriesToUpdate)) {
|
||||
inventoryMapper.updateById(inventoriesToUpdate);
|
||||
if (CollectionUtils.isNotEmpty(inventories)) {
|
||||
inventoryMapper.updateById(inventories);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,20 +32,26 @@
|
|||
|
||||
<select id="queryByAreaIdAndCountTypeAndCodes" resultType="org.cpte.modules.inventory.entity.Inventory">
|
||||
SELECT inv.* FROM data_inventory inv
|
||||
JOIN base_point point ON point.id = inv.point_id
|
||||
AND point.area_id = #{areaId}
|
||||
WHERE inv.status =1
|
||||
AND inv.quantity > 0
|
||||
INNER JOIN base_point point ON point.id = inv.point_id
|
||||
<choose>
|
||||
<when test="countType == 0">
|
||||
INNER JOIN base_item item ON item.id = inv.item_id
|
||||
</when>
|
||||
<when test="countType == 1">
|
||||
INNER JOIN base_stock stock ON stock.id = inv.stock_id
|
||||
</when>
|
||||
</choose>
|
||||
WHERE inv.status = 1
|
||||
AND inv.quantity > 0
|
||||
AND point.area_id = #{areaId}
|
||||
<choose>
|
||||
<when test="countType == 0">
|
||||
JOIN base_item item ON item.id=inv.item_id
|
||||
AND item.item_code IN
|
||||
<foreach collection="codes" item="code" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test="countType == 1">
|
||||
JOIN base_stock stock ON stock.id=inv.stock_id
|
||||
AND stock.stock_code IN
|
||||
<foreach collection="codes" item="code" open="(" separator="," close=")">
|
||||
#{code}
|
||||
|
|
|
|||
Loading…
Reference in New Issue