rev:点位,任务,区域修改

This commit is contained in:
2024-04-02 15:28:41 +08:00
parent 976c2bb283
commit f9aceb9eb8
5 changed files with 81 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ package org.nl.wms.pdm.bi.controller;
import java.util.Set;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import org.nl.common.base.TableDataInfo;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor;
@@ -104,5 +105,19 @@ public class PdmBiRawfoilworkorderController {
}
@Log("称重")
@PostMapping("/confirm")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
pdmBiRawfoilworkorderService.confirm(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("强制确认")
@PostMapping("/compelEnd")
public ResponseEntity<Object> compelEnd(@RequestBody JSONObject whereJson) {
pdmBiRawfoilworkorderService.compelEnd(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -1,5 +1,6 @@
package org.nl.wms.pdm.bi.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.pdm.bi.dao.PdmBiRawfoilworkorder;
@@ -58,7 +59,19 @@ public interface IpdmBiRawfoilworkorderService extends IService<PdmBiRawfoilwork
* @param ids /
*/
void deleteAll(Set<String> ids);
/**
* 强制确认
*
* @param whereJson /
*/
void compelEnd(JSONObject whereJson);
/**
* 称重
*
* @param whereJson /
*/
void confirm(JSONObject whereJson);
}

View File

@@ -1,5 +1,7 @@
package org.nl.wms.pdm.bi.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -23,6 +25,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.common.domain.query.PageQuery;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@@ -77,7 +80,7 @@ public class PdmBiRawfoilworkorderServiceImpl extends ServiceImpl<PdmBiRawfoilwo
if (whereJson.containsKey("end_time")) {
queryWrapper.le(PdmBiRawfoilworkorder::getCreate_time, whereJson.get("end_time"));
}
queryWrapper.eq(PdmBiRawfoilworkorder::getIs_delete,IOSEnum.IS_NOTANDYES.code(""));
queryWrapper.eq(PdmBiRawfoilworkorder::getIs_delete, IOSEnum.IS_NOTANDYES.code(""));
queryWrapper.orderByDesc(PdmBiRawfoilworkorder::getCreate_time);
return pdmBiRawfoilworkorderMapper.selectPage(resultPage, queryWrapper);
}
@@ -105,7 +108,7 @@ public class PdmBiRawfoilworkorderServiceImpl extends ServiceImpl<PdmBiRawfoilwo
*/
@Override
public void create(PdmBiRawfoilworkorderParam params) {
parametersValidation(params,true);
parametersValidation(params, true);
pdmBiRawfoilworkorderMapper.insert(getBasicInfo(params, true));
}
@@ -117,7 +120,7 @@ public class PdmBiRawfoilworkorderServiceImpl extends ServiceImpl<PdmBiRawfoilwo
*/
@Override
public void update(PdmBiRawfoilworkorderParam params) {
parametersValidation(params,false);
parametersValidation(params, false);
pdmBiRawfoilworkorderMapper.updateById(getBasicInfo(params, false));
}
@@ -189,6 +192,47 @@ public class PdmBiRawfoilworkorderServiceImpl extends ServiceImpl<PdmBiRawfoilwo
return pdmBiRawfoilworkorder;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void compelEnd(JSONObject whereJson) {
// String workorder_id = whereJson.getString("workorder_id");
// String currentUserId = SecurityUtils.getCurrentUserId();
// String currentUsername = SecurityUtils.getCurrentUsername();
//
// //查询该生箔工单是否存在未完成的任务
// String container_name = whereJson.getString("container_name");
//
// JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("material_code = '" + container_name + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
// if (ObjectUtil.isNotEmpty(task_jo)) {
// throw new BadRequestException("该生箔工单存在未完成的任务,请先完成任务!");
// }
//
// WQLObject tab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
//
// JSONObject json = tab.query("workorder_id = '" + workorder_id + "'").uniqueResult(0);
// json.put("status", "09");
// json.put("finish_type", "02");
// json.put("realend_time", DateUtil.now());
// json.put("update_optid", currentUserId);
// json.put("update_optname", currentUsername);
// json.put("update_time", DateUtil.now());
// tab.update(json);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void confirm(JSONObject whereJson) {
// WQLObject tab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
// String productin_qty = whereJson.getString("productin_qty");
//
// JSONObject jsonRaw = tab.query("workorder_id = '" + whereJson.getString("workorder_id") + "'").uniqueResult(0);
// if (ObjectUtil.isEmpty(productin_qty)) {
// jsonRaw.put("productin_qty", 0);
// } else {
// jsonRaw.put("productin_qty", whereJson.getDoubleValue("productin_qty"));
// }
// tab.update(jsonRaw);
}
}

View File

@@ -53,10 +53,10 @@ public class SchBaseRegion implements Serializable {
private String create_time;
private String update_id;
private String update_optid;
private String update_name;
private String update_optname;
private String update_time;

View File

@@ -58,8 +58,8 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
entity.setCreate_id(currentUserId);
entity.setCreate_name(nickName);
entity.setCreate_time(now);
entity.setUpdate_id(currentUserId);
entity.setUpdate_name(nickName);
entity.setUpdate_optid(currentUserId);
entity.setUpdate_optname(nickName);
entity.setUpdate_time(now);
schBaseRegionMapper.insert(entity);
}
@@ -69,8 +69,8 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
entity.setUpdate_id(currentUserId);
entity.setUpdate_name(nickName);
entity.setUpdate_optid(currentUserId);
entity.setUpdate_optname(nickName);
entity.setUpdate_time(now);
schBaseRegionMapper.updateById(entity);