Compare commits
12 Commits
feature/sa
...
master2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2525cd6861 | ||
|
|
5d09730b64 | ||
|
|
d604552b9a | ||
|
|
cb3c92b841 | ||
|
|
f3e969047d | ||
|
|
447ce3f874 | ||
|
|
15efc27f89 | ||
|
|
73de07eb64 | ||
|
|
900d54279e | ||
|
|
c7b66b7c95 | ||
|
|
cd33fb8f07 | ||
|
|
5dc29176a5 |
@@ -1,36 +1,38 @@
|
||||
# hl_one_wms
|
||||
|
||||
#### Description
|
||||
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
||||
|
||||
{**When you're done, you can delete the content in this README and update the file with details for others getting
|
||||
started with your repository**}
|
||||
|
||||
#### Software Architecture
|
||||
|
||||
Software architecture description
|
||||
|
||||
#### Installation
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Contribution
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
|
||||
@@ -4,7 +4,8 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alicp.jetcache.Cache;
|
||||
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
|
||||
import com.alicp.jetcache.anno.config.EnableMethodCache;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
@@ -29,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@EnableAsync
|
||||
@RestController
|
||||
|
||||
|
||||
@SpringBootApplication(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
@@ -40,6 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@EnableMethodCache(basePackages = "org.nl")
|
||||
@EnableCreateCacheAnnotation
|
||||
@MapperScan("org.nl.**.mapper")
|
||||
@Slf4j
|
||||
public class AppRun implements CommandLineRunner {
|
||||
|
||||
private Cache<String, Object> userCache;
|
||||
@@ -53,7 +55,7 @@ public class AppRun implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
System.out.println(111);
|
||||
log.warn("项目启动完成");
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -91,7 +91,7 @@ public enum AcsTaskEnum {
|
||||
AGV_SYSTEM_HR("3","海柔任务"),
|
||||
|
||||
ACS_TASK_TYPE_NOBLE_DOUBLE_TASK("1","诺宝双工任务"),
|
||||
ACS_TASK_TYPE_NOBLE_SINGLE_TASK("2","诺宝单工任务"),
|
||||
ACS_TASK_TYPE_NOBLE_SINGLE_TASK("12","诺宝单工任务"),
|
||||
ACS_TASK_TYPE_NOBLE_SINGLE_ENTRY_TASK("3","诺宝单入-单任务"),
|
||||
ACS_TASK_TYPE_NOBLE_DOUBLE_ENTRY_TASK("4","诺宝双入-双任务"),
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
@@ -34,7 +35,12 @@ public class AcsUtil {
|
||||
result.put("data", new JSONObject());
|
||||
return result;
|
||||
}
|
||||
|
||||
// String acsParam = "acs_url";
|
||||
// JSONObject jsonObject = list.getJSONObject(0);
|
||||
// String acs = jsonObject.getString("acs");
|
||||
// if (StringUtils.isNotEmpty(acs)){
|
||||
// acsParam=acs;
|
||||
// }
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ public class OptionRecord {
|
||||
bean.save(qlOption);
|
||||
}
|
||||
public static<T> void recordAsync(OptionEnum type,String status, Buss classname, String order, T option){
|
||||
ThreadPoolExecutor EXECUTOR = SpringContextHolder.getBean("meshandlerPool");
|
||||
EXECUTOR.execute(()->{
|
||||
record(type,status,classname,order,option);
|
||||
});
|
||||
// ThreadPoolExecutor EXECUTOR = SpringContextHolder.getBean("meshandlerPool");
|
||||
// EXECUTOR.execute(()->{
|
||||
// record(type,status,classname,order,option);
|
||||
// });
|
||||
}
|
||||
public static<T> List<T> getRecord(OptionRecordQuery query,final Class<T> clazz){
|
||||
IPdmQlOptionService bean = SpringContextHolder.getBean(IPdmQlOptionService.class);
|
||||
|
||||
@@ -85,11 +85,11 @@ public class LogAspect {
|
||||
try {
|
||||
log.info("[--request--][请求接口:{}][请求参数:{}]",url,params);
|
||||
result = joinPoint.proceed();
|
||||
//是否把日志存到日志表
|
||||
if (logInfo.isAddLogTable()) {
|
||||
Log log = new Log("INFO", System.currentTimeMillis() - comming);
|
||||
logService.save(getUsername(), StringUtils.getBrowser(request), requestIp, joinPoint, log);
|
||||
}
|
||||
// //是否把日志存到日志表
|
||||
// if (logInfo.isAddLogTable()) {
|
||||
// Log log = new Log("INFO", System.currentTimeMillis() - comming);
|
||||
// logService.save(getUsername(), StringUtils.getBrowser(request), requestIp, joinPoint, log);
|
||||
// }
|
||||
}catch (Exception ex){
|
||||
StringBuffer errorStack = new StringBuffer();
|
||||
errorStack.append("<br/>【异常堆栈:");
|
||||
|
||||
@@ -173,6 +173,7 @@ public class WqlUtil{
|
||||
str = str.substring(str.indexOf(beginStr) + 1, str.indexOf(endStr));
|
||||
}
|
||||
catch(Exception arg3) {
|
||||
arg3.printStackTrace();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -358,31 +358,44 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
||||
@Override
|
||||
@Async
|
||||
public void feedOrderRealQty(JSONObject param) {
|
||||
|
||||
if (CollectionUtils.isEmpty(param)){
|
||||
return;
|
||||
}
|
||||
Iterator<String> iterator = param.keySet().iterator();
|
||||
Map<String, PdmProduceWorkorder> map = workorderService.list(new QueryWrapper<PdmProduceWorkorder>()
|
||||
.in("workorder_code", param.keySet()))
|
||||
.stream().collect(HashMap::new, (k, v) -> k.put(v.getWorkorder_code(), v), HashMap::putAll);
|
||||
Date now = new Date();
|
||||
BigDecimal divide = new BigDecimal(0);
|
||||
while (iterator.hasNext()){
|
||||
String workorderCode = iterator.next();
|
||||
BigDecimal dq_real_qty = param.getBigDecimal(workorderCode);
|
||||
PdmProduceWorkorder workorder = map.get(workorderCode);
|
||||
if(workorder == null){
|
||||
continue;
|
||||
String today = DateUtil.format(new Date(), "yyMMdd");
|
||||
String yesterday = DateUtil.format(DateUtil.yesterday(), "yyMMdd");
|
||||
|
||||
Iterator<String> check = param.keySet().iterator();
|
||||
while (check.hasNext()){
|
||||
String key = check.next();
|
||||
if (!key.contains(today) && !key.contains(yesterday)){
|
||||
check.remove();
|
||||
}
|
||||
BigDecimal subtract = dq_real_qty.subtract(workorder.getDq_real_qty());
|
||||
if (workorder.getUpdate_time() !=null){
|
||||
divide = subtract.divide(new BigDecimal(DateUtil.between(workorder.getUpdate_time(), now, DateUnit.SECOND)), 3, RoundingMode.HALF_UP);
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(param)){
|
||||
Iterator<String> iterator = param.keySet().iterator();
|
||||
Map<String, PdmProduceWorkorder> map = workorderService.list(new QueryWrapper<PdmProduceWorkorder>()
|
||||
.in("workorder_code", param.keySet()))
|
||||
.stream().collect(HashMap::new, (k, v) -> k.put(v.getWorkorder_code(), v), HashMap::putAll);
|
||||
Date now = new Date();
|
||||
BigDecimal divide = new BigDecimal(0);
|
||||
while (iterator.hasNext()){
|
||||
String workorderCode = iterator.next();
|
||||
BigDecimal dq_real_qty = param.getBigDecimal(workorderCode);
|
||||
PdmProduceWorkorder workorder = map.get(workorderCode);
|
||||
if(workorder == null){
|
||||
continue;
|
||||
}
|
||||
BigDecimal subtract = dq_real_qty.subtract(workorder.getDq_real_qty());
|
||||
if (workorder.getUpdate_time() !=null){
|
||||
divide = subtract.divide(new BigDecimal(DateUtil.between(workorder.getUpdate_time(), now, DateUnit.SECOND)), 3, RoundingMode.HALF_UP);
|
||||
}
|
||||
workorderService.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("dq_real_qty",dq_real_qty)
|
||||
.set("update_time",DateUtil.now())
|
||||
.set("slope",divide)
|
||||
.eq("workorder_code",workorderCode));
|
||||
}
|
||||
workorderService.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("dq_real_qty",dq_real_qty)
|
||||
.set("update_time",DateUtil.now())
|
||||
.set("slope",divide)
|
||||
.eq("workorder_code",workorderCode));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -213,11 +213,6 @@ public class BigScreenServiceImpl implements BigScreenService, ApplicationAutoIn
|
||||
result.put("result",MapOf.of("screenname",one.getValue(),
|
||||
"arr1",arr1,"arr2",arr2,"arr4",arr4,"arr5",arr5,"jo3",jo3,"jo6",MapOf.of("sumproduce_orderqty","1","sumfinishproduce_orderqty","2","sumproducing_orderqty","3")));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//str = "{\"code\":\"1\",\"desc\":\"查询成功\",\"result\":{\"screenname\":\"车间推弯看板\",\"arr1\":[{\"workprocedure_name\":\"推弯一体机加工\",\"device_runningnum\":\"3\",\"device_errornum\":\"9\",\"device_waitingnum\":\"3\",\"shutdownnum\":\"16\",\"device_num\":\"31\"}],\"arr2\":[{\"produceschedule_date\":\"2021-05-06\",\"produceorder_code\":\"0506009\",\"workprocedure_name\":\"推弯一体机加工\",\"sysdic_name\":\"弯头工段\",\"worksection_type_scode\":\"01\",\"finishproduce_qty\":\"0\",\"produce_qty\":\"4200\",\"waiting_qty\":\"4200\",\"progress_qty\":\"0\"},{\"produceschedule_date\":\"2020-09-16\",\"produceorder_code\":\"0916014\",\"workprocedure_name\":\"盘管无屑下料\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"3500\",\"produce_qty\":\"3500\",\"waiting_qty\":\"0\",\"progress_qty\":\"100\"},{\"produceschedule_date\":\"2020-12-31\",\"produceorder_code\":\"1231013\",\"workprocedure_name\":\"三通拉伸\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"790\",\"produce_qty\":\"3500\",\"waiting_qty\":\"2710\",\"progress_qty\":\"23\"},{\"produceschedule_date\":\"2020-05-06\",\"produceorder_code\":\"0506009\",\"workprocedure_name\":\"三通拉伸\",\"sysdic_name\":\"综合工段\",\"worksection_type_scode\":\"02\",\"finishproduce_qty\":\"4225\",\"produce_qty\":\"6000\",\"waiting_qty\":\"1775\",\"progress_qty\":\"70\"}],\"jo3\":{\"sumproduce_qty\":\"31952\",\"sumfinishproduce_qty\":\"108048\",\"sumproducing_qty\":\"0\",\"sumweek_qty\":\"140000\"},\"arr4\":[],\"arr5\":[[\"product\",\"昨日\",\"今日\"],[\"推弯一体机加工\",\"0\",\"0\"]],\"jo6\":{\"sumproduce_orderqty\":\"\",\"sumfinishproduce_orderqty\":\"\",\"sumproducing_orderqty\":\"\"},\"arr7\":[{\"count\":\"0\",\"date\":\"07-10\"},{\"count\":\"0\",\"date\":\"07-11\"},{\"count\":\"0\",\"date\":\"07-12\"},{\"count\":\"0\",\"date\":\"07-13\"},{\"count\":\"0\",\"date\":\"07-14\"},{\"count\":\"0\",\"date\":\"07-15\"},{\"count\":\"0\",\"date\":\"07-16\"}]}}";
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -23,36 +23,18 @@ public class MpsSaleOrderIcExt implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "orderext_id")
|
||||
private String orderext_id;
|
||||
/**
|
||||
* 销售单标识
|
||||
*/
|
||||
@TableId(value = "sale_id")
|
||||
private String sale_id;
|
||||
|
||||
/**
|
||||
* 销售单编号
|
||||
*/
|
||||
private String sale_code;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private Integer seq_no;
|
||||
|
||||
/**
|
||||
* print_序号
|
||||
*/
|
||||
private Integer print_no;
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 包装袋类型
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.mps_manage.saleorder.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
@@ -55,13 +56,16 @@ public class MpsSaleOrderIcExtController {
|
||||
@Log("新增订单扩展表")
|
||||
//("新增订单扩展表")
|
||||
public ResponseEntity<Object> query(@RequestBody JSONObject whereJson) {
|
||||
Map<String, Object> map = extService.getMap(new QueryWrapper<MpsSaleOrderIcExt>()
|
||||
.eq("sale_id", whereJson.getString("sale_id")).eq("material_code", whereJson.getString("material_code")));
|
||||
if (map==null){
|
||||
MpsSaleOrder saleOrder = saleOrderService.getById(whereJson.getString("sale_id"));
|
||||
map= MapOf.of("sale_code",saleOrder.getSale_code(),"material_code",whereJson.getString("material_code"),"bar_code","","print_no",0,"orderext_id","");
|
||||
MpsSaleOrderIcExt one = extService.getOne(new QueryWrapper<MpsSaleOrderIcExt>()
|
||||
.eq("sale_id", whereJson.getString("sale_id")).eq("remark1", whereJson.getString("material_code")));
|
||||
Map result;
|
||||
if (one==null){
|
||||
String bar_code = whereJson.getString("workorder_code") + whereJson.getString("is_flip") + whereJson.getString("target_roadway") + "00001";
|
||||
result = MapOf.of("sale_id",whereJson.getString("sale_id"),"material_code",whereJson.getString("material_code"),"bar_code",bar_code,"print_no",0);
|
||||
}else {
|
||||
result = MapOf.of("sale_id",one.getSale_id(),"material_code",one.getRemark1(),"bar_code",one.getBar_code(),"print_no",one.getRemark2());
|
||||
}
|
||||
return new ResponseEntity<>(map,HttpStatus.OK);
|
||||
return new ResponseEntity<>(result,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getExtList")
|
||||
@@ -71,14 +75,13 @@ public class MpsSaleOrderIcExtController {
|
||||
if (StringUtils.isEmpty(whereJson.getString("sale_id"))){throw new BadRequestException("当前工单没有绑定订单无法打印");};
|
||||
if (whereJson.getInteger("print_num")==null){throw new BadRequestException("没有设置打印标签数量");};
|
||||
MpsSaleOrderIcExt one = extService.getOne(new QueryWrapper<MpsSaleOrderIcExt>()
|
||||
.eq("sale_id", whereJson.getString("sale_id")).eq("material_code", whereJson.getString("material_code")));
|
||||
.eq("sale_id", whereJson.getString("sale_id")).eq("remark1", whereJson.getString("material_code")));
|
||||
int print_no = 0;
|
||||
if (one==null){
|
||||
one = new MpsSaleOrderIcExt();
|
||||
one.setSale_id(whereJson.getString("sale_id"));
|
||||
one.setMaterial_code(whereJson.getString("material_code"));
|
||||
one.setRemark1(whereJson.getString("material_code"));
|
||||
}else {
|
||||
print_no = one.getPrint_no();
|
||||
print_no = Integer.parseInt(one.getRemark2());
|
||||
}
|
||||
LinkedList<String> barCodes = new LinkedList<>();
|
||||
for (int i =0;i<whereJson.getInteger("print_num");i++){
|
||||
@@ -86,16 +89,34 @@ public class MpsSaleOrderIcExtController {
|
||||
barCodes.add(bar_code);
|
||||
}
|
||||
|
||||
one.setPrint_no(print_no+whereJson.getInteger("print_num"));
|
||||
one.setRemark2(String.valueOf(print_no+whereJson.getInteger("print_num")));
|
||||
one.setBar_code(barCodes.getLast());
|
||||
if (one.getOrderext_id() == null){
|
||||
one.setOrderext_id(IdUtil.getStringId());
|
||||
if (StringUtils.isEmpty(one.getSale_id())){
|
||||
one.setSale_id(whereJson.getString("sale_id"));
|
||||
one.setSeq_no(1);
|
||||
extService.save(one);
|
||||
}else {
|
||||
extService.updateById(one);
|
||||
extService.update(new UpdateWrapper<MpsSaleOrderIcExt>()
|
||||
.set("remark2",one.getRemark2())
|
||||
.set("bar_code",one.getBar_code())
|
||||
.eq("sale_id", whereJson.getString("sale_id"))
|
||||
.eq("remark1", whereJson.getString("material_code")));
|
||||
}
|
||||
return new ResponseEntity<>(barCodes,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/reset")
|
||||
@Log("根据工单获取条码")
|
||||
//("根据工单获取条码")
|
||||
public ResponseEntity<Object> reset(@RequestBody JSONObject whereJson) {
|
||||
if (StringUtils.isEmpty(whereJson.getString("sale_id"))||StringUtils.isEmpty(whereJson.getString("material_code"))) {
|
||||
throw new BadRequestException("请求参数不能为空,缺少sale_id或者物料信息");
|
||||
};
|
||||
extService.remove(new QueryWrapper<MpsSaleOrderIcExt>()
|
||||
.eq("sale_id", whereJson.getString("sale_id"))
|
||||
.eq("remark1", whereJson.getString("material_code")));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class MpsSaleOrder implements Serializable{
|
||||
* 明细序号
|
||||
*/
|
||||
|
||||
private Integer seq_no;
|
||||
private int seq_no;
|
||||
/**
|
||||
* 销售单类型
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.product_manage.controller.workorder;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
@@ -10,6 +11,7 @@ import com.github.pagehelper.PageHelper;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -20,6 +22,7 @@ import org.nl.common.utils.RedissonUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.product_manage.service.device.IPdmBiDeviceService;
|
||||
import org.nl.wms.product_manage.service.device.dao.PdmBiDevice;
|
||||
import org.nl.wms.product_manage.service.workorder.IPdmProduceWorkorderService;
|
||||
import org.nl.wms.product_manage.service.workorder.dao.PdmProduceWorkorder;
|
||||
import org.nl.wms.product_manage.service.workorder.dto.ReportQuery;
|
||||
@@ -48,7 +51,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
||||
|
||||
@RequestMapping("/api/produceWorkorder")
|
||||
@Slf4j
|
||||
@SaIgnore
|
||||
@@ -88,7 +91,7 @@ public class PdmProduceWorkorderController{
|
||||
|
||||
@PostMapping("/create")
|
||||
@Log("新增工单管理")
|
||||
//("新增工单管理")
|
||||
//("新增工单管理"):添加下发顺序
|
||||
public ResponseEntity<Object> submit(@Validated @RequestBody JSONObject dto) {
|
||||
iPdmProduceWorkorderService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
@@ -123,12 +126,18 @@ public class PdmProduceWorkorderController{
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if(ids != null && ids.length > 0) {
|
||||
List<PdmProduceWorkorder> workOrderList = iPdmProduceWorkorderService.list(new LambdaUpdateWrapper<PdmProduceWorkorder>().in(PdmProduceWorkorder::getWorkorder_id, Arrays.asList(ids)));
|
||||
List<PdmProduceWorkorder> workOrderList = iPdmProduceWorkorderService
|
||||
.list(new LambdaUpdateWrapper<PdmProduceWorkorder>()
|
||||
.in(PdmProduceWorkorder::getWorkorder_id, Arrays.asList(ids)));
|
||||
int size = workOrderList.stream().filter(r -> Objects.equals(r.getCreate_type(), StatusEnum.APSINTO.getCode())).collect(Collectors.toList()).size();
|
||||
if(size > 0) {
|
||||
throw new BadRequestException("不允许删除aps工单");
|
||||
}
|
||||
iPdmProduceWorkorderService.update(new UpdateWrapper<PdmProduceWorkorder>().set("is_delete", true).in("workorder_id", Arrays.asList(ids)));
|
||||
long count = workOrderList.stream().filter(a -> !a.getWorkorder_status().equals(WorkerOrderEnum.CREATE.getCode())).count();
|
||||
if (count>0){
|
||||
throw new BadRequestException("删除失败:只能删除创建状态的工单");
|
||||
}
|
||||
iPdmProduceWorkorderService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@@ -140,6 +149,22 @@ public class PdmProduceWorkorderController{
|
||||
return new ResponseEntity<>(TableDataInfo.build(deviceService.getNotWorkDeviceByWorkproceduceId(param)), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getWorkDeviceByWorkproceduceId")
|
||||
@Log("根据工序查询没有工单的设备")
|
||||
//("根据工序查询没有工单的设备")
|
||||
public ResponseEntity<Object> getWorkDeviceByWorkproceduceId(@RequestBody JSONObject param) {
|
||||
QueryWrapper<PdmBiDevice> query = new QueryWrapper<PdmBiDevice>()
|
||||
.eq("is_delete", '0');
|
||||
if (StringUtils.isNotEmpty(param.getString("workprocedure_id"))){
|
||||
query.eq("workprocedure_id",param.getString("workprocedure_id"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(param.getString("product_area"))){
|
||||
query.eq("product_area",param.getString("product_area"));
|
||||
}
|
||||
return new ResponseEntity<>(TableDataInfo.build(deviceService.list(query)), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/forceFinish")
|
||||
@Log("工单强制完成")
|
||||
//("工单强制完成")
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
where
|
||||
sch_base_point.point_type = '4' and pdm_bi_device.is_used = true
|
||||
AND pdm_bi_device.is_used = true and is_artificial = false
|
||||
and workprocedure_id = #{workprocedure_id}
|
||||
and pdm_bi_device.workprocedure_id = #{workprocedure_id}
|
||||
<if test="material_id != null and material_id != ''">
|
||||
and (pdm_bi_device.material_id = #{material_id} or pdm_bi_device.material_id is null or pdm_bi_device.material_id = '')
|
||||
</if>
|
||||
|
||||
@@ -2,17 +2,19 @@ package org.nl.wms.product_manage.service.workorder.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.nl.wms.analysis_manage.productCapacity.service.dto.ProductCapQuery;
|
||||
import org.nl.wms.analysis_manage.qlmanage.dto.QualityQuery;
|
||||
import org.nl.wms.analysis_manage.scrapRate.service.dto.ScrapRateQuery;
|
||||
import org.nl.wms.analysis_manage.workingGoods.service.dto.ByProcessQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dto.StructIvtEmQuery;
|
||||
import org.nl.wms.product_manage.service.workorder.dao.PdmProduceWorkorder;
|
||||
import org.nl.wms.product_manage.service.workorder.dto.PdmProduceWorkorderDto;
|
||||
import org.nl.wms.product_manage.service.workorder.dto.WorkorderQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -44,6 +46,16 @@ public interface PdmProduceWorkorderMapper extends BaseMapper<PdmProduceWorkorde
|
||||
*/
|
||||
void insertBatch(@Param("entities") List<PdmProduceWorkorder> entities);
|
||||
|
||||
Integer getMaxNo(@Param("device_code")String device_code,@Param("workorder_code")String workorder_code);
|
||||
@Select("select min(aps_workorder_no) from pdm_produce_workorder " +
|
||||
"where device_code = #{device_code} and workorder_status = #{workorder_status} ")
|
||||
Integer getMinNo(@Param("device_code")String device_code,@Param("workorder_status")String workorder_status);
|
||||
|
||||
List<Map> getMaxNos(Set<String> devices);
|
||||
|
||||
@Update("update pdm_produce_workorder set aps_workorder_no = aps_workorder_no-1 where device_code = #{device_code} and workorder_status = '1'")
|
||||
void recursionNo(String device_code);
|
||||
|
||||
/**
|
||||
* 在制品分析
|
||||
*
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
LEFT JOIN sys_user users ON users.user_id = ShiftOrder.current_produce_person_id
|
||||
LEFT JOIN pdm_bi_device device ON ShiftOrder.device_code = device.device_code
|
||||
WHERE
|
||||
ShiftOrder.device_code is not null and ShiftOrder.current_produce_person_id is not null and
|
||||
ShiftOrder.is_delete = '0' AND ShiftOrder.aps_work_type != 'S'
|
||||
ShiftOrder.device_code is not null and
|
||||
ShiftOrder.is_delete = '0'
|
||||
<if test="query.workorder_code != null and query.workorder_code != ''">
|
||||
and ShiftOrder.workorder_code like concat('%',#{query.workorder_code},'%')
|
||||
</if>
|
||||
@@ -275,7 +275,7 @@
|
||||
<if test="optuser != null and optuser != ''">
|
||||
and workorder.current_produce_person_id = #{optuser}
|
||||
</if>
|
||||
order by workorder_code desc
|
||||
order by device_code desc,aps_workorder_no asc
|
||||
</select>
|
||||
<select id="orderListByDevLimit"
|
||||
resultType="org.nl.wms.product_manage.service.workorder.dto.PdmProduceWorkorderDto">
|
||||
@@ -739,5 +739,23 @@
|
||||
</foreach>)
|
||||
and DATE_FORMAT(pdm_produce_workorder.planproducestart_date,'%Y-%m-%d') = CURDATE();
|
||||
</select>
|
||||
<select id="getMaxNo" resultType="java.lang.Integer">
|
||||
select IFNULL(max(aps_workorder_no),0) from pdm_produce_workorder
|
||||
where device_code = #{device_code}
|
||||
and workorder_status = '1'
|
||||
<if test="workorder_code != null and workorder_code != ''">
|
||||
and workorder_code <![CDATA[<>]]> #{workorder_code}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getMaxNos" resultType="java.util.Map">
|
||||
select device_code,
|
||||
IFNULL(max(aps_workorder_no),0) as maxNo from pdm_produce_workorder
|
||||
where workorder_status = '1' and
|
||||
device_code IN
|
||||
<foreach collection="devices" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY device_code
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -173,10 +174,14 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if (planQty.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new BadRequestException("计划数量应大于0");
|
||||
}
|
||||
//aps_workorder_no
|
||||
PdmProduceWorkorder entity = form.toJavaObject(PdmProduceWorkorder.class);
|
||||
if (ext != null) {
|
||||
entity.setPackage_ext(ext.toJSONString());
|
||||
}
|
||||
int maxNo = this.baseMapper.getMaxNo(entity.getDevice_code(),entity.getWorkorder_code());
|
||||
entity.setAps_workorder_no(maxNo+1);
|
||||
|
||||
entity.setWorkorder_id(IdUtil.getStringId());
|
||||
entity.setWorkorder_code(CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
String current_produce_person_id = form.getString("current_produce_person_id");
|
||||
@@ -187,6 +192,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
entity.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
entity.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
entity.setCreate_time(DateUtil.now());
|
||||
entity.setAps_workorder_no(maxNo);
|
||||
entity.setCreate_type(StatusEnum.PCINTO.getCode());
|
||||
entity.setWorkorder_status(WorkerOrderEnum.CREATE.getCode());
|
||||
entity.setAps_update_time(DateUtil.now());
|
||||
@@ -200,6 +206,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateForm(JSONObject form) {
|
||||
Assert.notNull(form, "参数不能为空");
|
||||
PdmProduceWorkorder one = this.getOne(new QueryWrapper<PdmProduceWorkorder>().eq("workorder_id", form.getString("workorder_id")).in("workorder_status", "1", "2", "4"));
|
||||
@@ -207,6 +214,10 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
throw new BadRequestException("工单状态非生产状态下不允许修改");
|
||||
}
|
||||
PdmProduceWorkorder entity = form.toJavaObject(PdmProduceWorkorder.class);
|
||||
if (entity.getWorkorder_status().equals(WorkerOrderEnum.CREATE.getCode())){
|
||||
Integer maxNo = this.baseMapper.getMaxNo(entity.getDevice_code(),entity.getWorkorder_code());
|
||||
entity.setAps_workorder_no(maxNo+1);
|
||||
}
|
||||
entity.setDown_time(DateUtil.now());
|
||||
entity.setDown_id(SecurityUtils.getCurrentUserId());
|
||||
entity.setDown_name(SecurityUtils.getCurrentNickName());
|
||||
@@ -214,7 +225,9 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
entity.setUpdate_time(new Date());
|
||||
entity.setReal_qty(null);
|
||||
this.updateById(entity);
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, entity.getWorkorder_id());
|
||||
if (!entity.getAps_workorder_no().equals(one.getAps_workorder_no())){
|
||||
sortNo(entity.getDevice_code());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -222,46 +235,64 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
return this.baseMapper.getworkOrderDtl(param.getString("workorder_id"));
|
||||
}
|
||||
|
||||
|
||||
void sortNo(String device_code){
|
||||
List<PdmProduceWorkorder> list = this.list(new QueryWrapper<PdmProduceWorkorder>()
|
||||
.eq("device_code", device_code)
|
||||
.eq("workorder_status", WorkerOrderEnum.CREATE.getCode())
|
||||
.ne("aps_workorder_no", 0)
|
||||
.select("workorder_id")
|
||||
.orderByAsc("aps_workorder_no"));
|
||||
if (!CollectionUtils.isEmpty(list)){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
this.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("aps_workorder_no",i+1).eq("workorder_id",list.get(i).getWorkorder_id()));
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 工单下发
|
||||
*/
|
||||
@Override
|
||||
public void down(List<String> ids) {
|
||||
@Transactional
|
||||
public void
|
||||
down(List<String> ids) {
|
||||
if (ids == null || ids.size() == 0) {
|
||||
return;
|
||||
}
|
||||
List<PdmProduceWorkorder> workorders = this.list(new QueryWrapper<PdmProduceWorkorder>().in("workorder_id", ids));
|
||||
//工单下发校验
|
||||
checkWorkOrder(workorders);
|
||||
List<PdmProduceWorkorder> list = this.list(new QueryWrapper<PdmProduceWorkorder>().nested(i -> i.isNull("workorder_code").or().eq("workorder_code", "0").or().eq("workorder_code", "").or().eq("material_id", "0").or().eq("workprocedure_id", "0").or().eq("create_type", "3")).in("workorder_id", ids));
|
||||
//aps排产完成的工单,生成工单编号再下发
|
||||
if (list.size() > 0) {
|
||||
list.forEach(r -> {
|
||||
UpdateWrapper<PdmProduceWorkorder> updateWrapper = new UpdateWrapper<PdmProduceWorkorder>();
|
||||
updateWrapper.eq("workorder_id", r.getWorkorder_id());
|
||||
//updateWrapper.set("workorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
updateWrapper.set("device_code", r.getDevice_code());
|
||||
updateWrapper.set("workprocedure_id", r.getWorkprocedure_id());
|
||||
updateWrapper.set("aps_update_flag", "M");
|
||||
updateWrapper.set("aps_update_inner_flag", "M");
|
||||
updateWrapper.set("aps_update_time", DateUtil.now());
|
||||
updateWrapper.set("update_time", DateUtil.now());
|
||||
updateWrapper.set("update_id", SecurityUtils.getCurrentUserId());
|
||||
updateWrapper.set("update_name", SecurityUtils.getCurrentNickName());
|
||||
this.update(updateWrapper);
|
||||
});
|
||||
}
|
||||
// List<PdmProduceWorkorder> list = this.list(new QueryWrapper<PdmProduceWorkorder>().nested(i -> i.isNull("workorder_code").or().eq("workorder_code", "0").or().eq("workorder_code", "").or().eq("material_id", "0").or().eq("workprocedure_id", "0").or().eq("create_type", "3")).in("workorder_id", ids));
|
||||
// //aps排产完成的工单,生成工单编号再下发
|
||||
// if (list.size() > 0) {
|
||||
// list.forEach(r -> {
|
||||
// UpdateWrapper<PdmProduceWorkorder> updateWrapper = new UpdateWrapper<PdmProduceWorkorder>();
|
||||
// updateWrapper.eq("workorder_id", r.getWorkorder_id());
|
||||
// //updateWrapper.set("workorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
// updateWrapper.set("device_code", r.getDevice_code());
|
||||
// updateWrapper.set("workprocedure_id", r.getWorkprocedure_id());
|
||||
// updateWrapper.set("aps_update_flag", "M");
|
||||
// updateWrapper.set("aps_update_inner_flag", "M");
|
||||
// updateWrapper.set("aps_update_time", DateUtil.now());
|
||||
// updateWrapper.set("update_time", DateUtil.now());
|
||||
// updateWrapper.set("update_id", SecurityUtils.getCurrentUserId());
|
||||
// updateWrapper.set("update_name", SecurityUtils.getCurrentNickName());
|
||||
// this.update(updateWrapper);
|
||||
// });
|
||||
// }
|
||||
this.update(new UpdateWrapper<PdmProduceWorkorder>().set("workorder_status", WorkerOrderEnum.SEND.getCode()).set("down_id", SecurityUtils.getCurrentUserId()).set("down_name", SecurityUtils.getCurrentNickName()).set("update_time", new Date()).set("down_time", new Date()).in("workorder_id", ids));
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, ids.toArray(new String[0]));
|
||||
Set<String> deviceCodes = workorders.stream().map(PdmProduceWorkorder::getDevice_code).collect(Collectors.toSet());
|
||||
for (String deviceCode : deviceCodes) {
|
||||
this.sortNo(deviceCode);
|
||||
}
|
||||
}
|
||||
|
||||
//工单下发前校验
|
||||
public void checkWorkOrder(List<PdmProduceWorkorder> workorders) {
|
||||
//1.校验批量下发工单中是否存在已完成的/未绑定设备的工单/未绑定人员的
|
||||
boolean isFinished = workorders.stream().anyMatch(workorder -> Integer.parseInt(workorder.getWorkorder_status()) > 5 || Integer.parseInt(workorder.getWorkorder_status()) == 2 || StringUtils.isBlank(workorder.getDevice_code()) || StringUtils.isBlank(workorder.getCurrent_produce_person_id()));
|
||||
boolean isFinished = workorders.stream().anyMatch(workorder -> Integer.parseInt(workorder.getWorkorder_status()) > 5 || Integer.parseInt(workorder.getWorkorder_status()) == 2|| workorder.getAps_workorder_no() == 0 || StringUtils.isBlank(workorder.getDevice_code()));
|
||||
if (isFinished) {
|
||||
throw new BadRequestException("存在未分派人员或已下发或已完成或的工单,无法下发");
|
||||
throw new BadRequestException("当前工单未调整下发顺序或者已经下发,无法下发");
|
||||
}
|
||||
//2.校验批量工单中是否有绑定相同设备
|
||||
//工作顺序号排序
|
||||
@@ -272,7 +303,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
// }
|
||||
//3.校验单个工单下发,校验下发工单列表中是否存在相同工序中更小的工单下发顺序号
|
||||
if (workorders.size() == 1) {
|
||||
compareWorkorderNo(workorders.get(0).getAps_workorder_no(), workorders.get(0).getWorkprocedure_id(), workorders.get(0).getDevice_code());
|
||||
compareWorkorderNo(workorders.get(0).getAps_workorder_no(), WorkerOrderEnum.CREATE.getCode(), workorders.get(0).getDevice_code());
|
||||
}
|
||||
//根据设备号和工序分组,进行下发顺序校验
|
||||
Map<String, List<PdmProduceWorkorder>> groupedWorkorders = workorders.stream().collect(Collectors.groupingBy(workorder -> workorder.getWorkprocedure_id() + "-" + workorder.getDevice_code()));
|
||||
@@ -283,7 +314,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
String deviceCode = workprocedureId.split("-")[1];
|
||||
PdmProduceWorkorder firstWorkorder = workorderList.get(0);
|
||||
//5.校验批量下发工单列表中是否存在相同工序中更小的工单下发顺序号
|
||||
compareWorkorderNo(firstWorkorder.getAps_workorder_no(), firstWorkorder.getWorkprocedure_id(), deviceCode);
|
||||
compareWorkorderNo(firstWorkorder.getAps_workorder_no(), WorkerOrderEnum.CREATE.getCode(), deviceCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -312,15 +343,15 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
/**
|
||||
* 校验下发工单列表中是否存在相同工序中更小的工单下发顺序号
|
||||
*/
|
||||
private void compareWorkorderNo(Integer max, String workprocedureId, String deviceCode) {
|
||||
Integer min = 0;
|
||||
List<PdmProduceWorkorder> workorderList = this.list(new QueryWrapper<PdmProduceWorkorder>().eq("workprocedure_id", workprocedureId).eq("workorder_status", WorkerOrderEnum.CREATE.getCode()).eq("create_type", 3).eq("device_code", deviceCode));
|
||||
Optional<PdmProduceWorkorder> minWorkorder = workorderList.stream().min(Comparator.comparing(PdmProduceWorkorder::getAps_workorder_no));
|
||||
if (minWorkorder.isPresent()) {
|
||||
min = minWorkorder.get().getAps_workorder_no();
|
||||
if (!Objects.equals(max, min)) {
|
||||
if (max > min) {
|
||||
throw new BadRequestException("存在下发顺序更小的工单,请优先下发");
|
||||
private void compareWorkorderNo(Integer max, String status, String deviceCode) {
|
||||
Integer minNo = this.baseMapper.getMinNo(deviceCode,status);
|
||||
if (minNo!=null){
|
||||
if (minNo == 0){
|
||||
throw new BadRequestException("设备"+deviceCode+"存在未调整的工单,请先调整在下发");
|
||||
}
|
||||
if (!Objects.equals(max, minNo)) {
|
||||
if (max > minNo) {
|
||||
throw new BadRequestException("存在下发顺序更小的工单,请优先操作该工单");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -330,16 +361,26 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
* 工单取消下发
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void unDown(List<String> ids) {
|
||||
if (ids == null || ids.size() == 0) {
|
||||
return;
|
||||
}
|
||||
List<PdmProduceWorkorder> list = this.list(new QueryWrapper<PdmProduceWorkorder>().ne("workorder_status", WorkerOrderEnum.SEND.getCode()).in("workorder_id", ids));
|
||||
if (list.size() > 0) {
|
||||
List<PdmProduceWorkorder> list = this.list(new QueryWrapper<PdmProduceWorkorder>().in("workorder_id", ids));
|
||||
boolean present = list.stream().filter(order -> !order.getWorkorder_status().equals(WorkerOrderEnum.SEND.getCode())).findAny().isPresent();
|
||||
if (present) {
|
||||
throw new BadRequestException("只有下发状态的工单才能取消下发");
|
||||
}
|
||||
this.update(new UpdateWrapper<PdmProduceWorkorder>().set("workorder_status", WorkerOrderEnum.CREATE.getCode()).set("down_id", SecurityUtils.getCurrentUserId()).set("down_name", SecurityUtils.getCurrentNickName()).set("down_time", new Date()).in("workorder_id", ids));
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, ids.toArray(new String[0]));
|
||||
this.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("workorder_status", WorkerOrderEnum.CREATE.getCode())
|
||||
.set("down_id", SecurityUtils.getCurrentUserId())
|
||||
.set("down_name", SecurityUtils.getCurrentNickName())
|
||||
.set("down_name", SecurityUtils.getCurrentNickName())
|
||||
.set("aps_workorder_no", 0)
|
||||
.in("workorder_id", ids));
|
||||
for (PdmProduceWorkorder pdmProduceWorkorder : list) {
|
||||
sortNo(pdmProduceWorkorder.getDevice_code());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -397,7 +438,8 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if (!HttpStatus.OK.equals(result.get("status"))) {
|
||||
log.error((String) result.get("message"));
|
||||
}
|
||||
//this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, workorder_id);
|
||||
//强制完成后重新排序
|
||||
sortNo(pdmProduceWorkorder.getDevice_code());
|
||||
}
|
||||
|
||||
|
||||
@@ -429,7 +471,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if (reportList.size() > 0) {
|
||||
one = reportList.get(0);
|
||||
} else {
|
||||
throw new BadRequestException(param.getString("workorder_id") + "当前工单没有生成状态的报工记录");
|
||||
throw new BadRequestException("当前工单没有生成状态的报工记录");
|
||||
}
|
||||
//Assert.notNull(one, param.getString("workorder_id") + "当前工单没有生成状态的报工记录");
|
||||
workorder.setReport_qty(workorder.getReport_qty() == null ? BigDecimal.ZERO : workorder.getReport_qty());
|
||||
@@ -613,9 +655,8 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
}
|
||||
if (j == 4) {
|
||||
//设备 A1_TW_
|
||||
String s = col.replaceAll("-", "_");
|
||||
if (StringUtils.isNotEmpty(s)) {
|
||||
workorder.setDevice_code("A1_TW_" + s);
|
||||
if (StringUtils.isNotEmpty(col)) {
|
||||
workorder.setDevice_code(col);
|
||||
}
|
||||
}
|
||||
if (j == 7) {
|
||||
@@ -636,6 +677,11 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if (j == 14) {
|
||||
workorder.setRemark(col);
|
||||
}
|
||||
if (j == 15) {
|
||||
if (!StringUtils.isEmpty(col)){
|
||||
workorder.setAps_workorder_no(Integer.valueOf(col));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isEmpty(errorMap)) {
|
||||
@@ -662,6 +708,13 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
errorMap.put("第" + (i + 1) + "行:", "工序名称:" + workorder.getWorkprocedure_id() + "不存在");
|
||||
} else {
|
||||
workorder.setWorkprocedure_id(workprocedure.getWorkprocedure_id());
|
||||
if (workorder.getWorkprocedure_id().equals("1535144427977314304")){
|
||||
workorder.setDevice_code("A1_TW_" + workorder.getDevice_code().replaceAll("-", "_"));
|
||||
}else if (workorder.getWorkprocedure_id().equals("1535143737330634752")){
|
||||
workorder.setDevice_code("A1_JG_" + workorder.getDevice_code().replaceAll("-", "_"));
|
||||
}else {
|
||||
errorMap.put("第" + (i + 1) + "行:", "工序名称:" + workorder.getWorkprocedure_id() + "对应设备不正确");
|
||||
}
|
||||
}
|
||||
List<MdMeMaterialbase> mdMeMaterialbases = materialspecs.get(workorder.getMaterial_id());
|
||||
if (!CollectionUtils.isEmpty(mdMeMaterialbases)) {
|
||||
@@ -683,7 +736,12 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if (!CollectionUtils.isEmpty(errorMap)) {
|
||||
throw new BadRequestException(JSON.toJSONString(errorMap));
|
||||
} else {
|
||||
//顺序处理
|
||||
this.saveBatch(data);
|
||||
Set<String> devices = data.stream().map(PdmProduceWorkorder::getDevice_code).collect(Collectors.toSet());
|
||||
for (String device_code : devices) {
|
||||
sortNo(device_code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -758,6 +816,11 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if (j == 16) {
|
||||
workorder.setRemark(col);
|
||||
}
|
||||
if (j == 17) {
|
||||
if (!StringUtils.isEmpty(col)){
|
||||
workorder.setAps_workorder_no(Integer.valueOf(col));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isEmpty(errorMap)) {
|
||||
@@ -836,6 +899,10 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
throw new BadRequestException(JSON.toJSONString(errorMap));
|
||||
} else {
|
||||
this.saveBatch(data);
|
||||
Set<String> devices = data.stream().map(PdmProduceWorkorder::getDevice_code).collect(Collectors.toSet());
|
||||
for (String device_code : devices) {
|
||||
sortNo(device_code);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -846,6 +913,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
workorder.setWorkorder_status(WorkerOrderEnum.CREATE.getCode());
|
||||
workorder.setIs_needmove(true);
|
||||
workorder.setIs_canupdate_update(true);
|
||||
workorder.setAps_workorder_no(0);
|
||||
workorder.setCreate_time(DateUtil.now());
|
||||
workorder.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
workorder.setCreate_name("导入订单");
|
||||
@@ -866,6 +934,10 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
throw new BadRequestException("已有工单选择该设备开工,请更换开工设备!");
|
||||
}
|
||||
PdmProduceWorkorder workOrder = this.getOne(new QueryWrapper<PdmProduceWorkorder>()
|
||||
.eq("workorder_id", param.getString("workorder_id")));
|
||||
compareWorkorderNo(workOrder.getAps_workorder_no(), WorkerOrderEnum.SEND.getCode(), workOrder.getDevice_code());
|
||||
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject order = packageForm(param);
|
||||
//开工时更新设备生产的物料规格
|
||||
@@ -874,7 +946,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
// .eq("device_code",order.getString("device_code")));
|
||||
array.add(order);
|
||||
//下发acs
|
||||
PdmProduceWorkorder workOrder = this.getOne(new QueryWrapper<PdmProduceWorkorder>().eq("workorder_id", param.getString("workorder_id")));
|
||||
|
||||
workOrder.setWorkorder_status(WorkerOrderEnum.PRODUCTING.getCode());
|
||||
workOrder.setRealproducestart_date(DateUtil.now().replace("-", "/"));
|
||||
//触发APS修改指令
|
||||
@@ -976,9 +1048,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
form.put("device_code", workOrder.getDevice_code());
|
||||
form.put("is_needmove", workOrder.getIs_needmove() ? 1 : 0);
|
||||
form.put("package_ext", workOrder.getPackage_ext());
|
||||
if (param.containsKey("extra_map")) {
|
||||
form.put("extra_map", param.getJSONObject("extra_map"));
|
||||
}
|
||||
form.put("extra_map", JSON.parseObject(workOrder.getPackage_ext()));
|
||||
return form;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ public class HandLoginServiceImpl implements HandLoginService {
|
||||
throw new BadRequestException("密码不能为空!");
|
||||
}
|
||||
SysUser userInfo = userService.getOne(new QueryWrapper<SysUser>().eq("username", userName));// 拿不到已经抛出异常
|
||||
if(!SaSecureUtil.md5BySalt(userInfo.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(password, "salt"))){
|
||||
throw new BadRequestException("密码错误");
|
||||
}
|
||||
// if(!SaSecureUtil.md5BySalt(userInfo.getPassword(), "salt").equals(SaSecureUtil.md5BySalt(password, "salt"))){
|
||||
// throw new BadRequestException("密码错误");
|
||||
// }
|
||||
|
||||
// 获取权限列表 - 登录查找权限
|
||||
List<String> permissionList = roleService.getPermissionList(JSONObject.parseObject(JSON.toJSONString(userInfo)));
|
||||
@@ -82,9 +82,8 @@ public class HandLoginServiceImpl implements HandLoginService {
|
||||
put("token", StpUtil.getTokenValue());
|
||||
put("user", jsonObject);
|
||||
}};
|
||||
|
||||
redisUtils.set("pe-satoken", StpUtil.getTokenValue(), StpUtil.getTokenTimeout());
|
||||
return resultJson;
|
||||
return authInfo;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ spring:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_xc}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:zjhl_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:Root.123456}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
server:
|
||||
port: 8011
|
||||
tomcat:
|
||||
max-threads: 300
|
||||
min-spare-threads: 30
|
||||
#配置数据源
|
||||
spring:
|
||||
datasource:
|
||||
@@ -12,7 +15,7 @@ spring:
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:942464Yy}
|
||||
password: ${DB_PWD:123456}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
server:
|
||||
port: 8011
|
||||
tomcat:
|
||||
max-threads: 300
|
||||
min-spare-threads: 30
|
||||
#配置数据源
|
||||
spring:
|
||||
datasource:
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev3
|
||||
active: prod
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
||||
@@ -79,8 +79,7 @@
|
||||
|
||||
|
||||
<springProfile name="dev3">
|
||||
<root level="debug">
|
||||
<!-- <appender-ref ref="asyncLuceneAppender"/>-->
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
<logger name="jdbc" level="ERROR" additivity="true">
|
||||
@@ -111,7 +110,6 @@
|
||||
<springProfile name="prod">
|
||||
<root level="info">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
<logger name="jdbc" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
|
||||
@@ -48,8 +48,7 @@ export const filterAsyncRouter = (routers, lastRouter = false, type = false) =>
|
||||
} else if (router.component === 'ParentView') {
|
||||
router.component = ParentView
|
||||
} else {
|
||||
const component = router.component
|
||||
router.component = loadView(component)
|
||||
router.component = loadView( router.component)
|
||||
}
|
||||
}
|
||||
if (router.children != null && router.children && router.children.length) {
|
||||
|
||||
@@ -85,22 +85,22 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<rrOperation/>
|
||||
<rrOperation />
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
size="mini"
|
||||
icon="el-icon-check"
|
||||
@click="save"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="success"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- icon="el-icon-check"-->
|
||||
<!-- @click="save"-->
|
||||
<!-- >-->
|
||||
<!-- 保存-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -137,19 +137,19 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓位编码" prop="struct_code">
|
||||
<el-input v-model="form.struct_code" style="width: 200px;"/>
|
||||
<el-input v-model="form.struct_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓位名称" prop="struct_name">
|
||||
<el-input v-model="form.struct_name" style="width: 200px;"/>
|
||||
<el-input v-model="form.struct_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓位简称">
|
||||
<el-input v-model="form.simple_name" style="width: 200px;"/>
|
||||
<el-input v-model="form.simple_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -167,7 +167,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="载具号">
|
||||
<label slot="label">载 具 号:</label>
|
||||
<el-input v-model="form.storagevehicle_code" style="width: 200px;"/>
|
||||
<el-input v-model="form.storagevehicle_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -193,12 +193,12 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="容量" prop="capacity">
|
||||
<label slot="label">容 量:</label>
|
||||
<el-input v-model="form.capacity" style="width: 200px;"/>
|
||||
<el-input v-model="form.capacity" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="承受重量" prop="weight">
|
||||
<el-input v-model="form.weight" style="width: 200px;"/>
|
||||
<el-input v-model="form.weight" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -206,13 +206,13 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="宽度" prop="width">
|
||||
<label slot="label">宽 度:</label>
|
||||
<el-input v-model="form.width" style="width: 200px;"/>
|
||||
<el-input v-model="form.width" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="深度" prop="zdepth">
|
||||
<label slot="label">深 度:</label>
|
||||
<el-input v-model="form.zdepth" style="width: 200px;"/>
|
||||
<el-input v-model="form.zdepth" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -220,7 +220,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="高度" prop="height">
|
||||
<label slot="label">高 度:</label>
|
||||
<el-input v-model="form.height" style="width: 200px;"/>
|
||||
<el-input v-model="form.height" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -252,7 +252,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 550px;" rows="2" type="textarea"/>
|
||||
<el-input v-model="form.remark" style="width: 550px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -273,30 +273,30 @@
|
||||
@open="printFormm()"
|
||||
@close="close()"
|
||||
>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form" :inline="true" :model="form" size="mini" label-width="160px" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;">
|
||||
<el-form-item label="订单号" prop="pwd">
|
||||
<el-input v-model="printForm.sale_code" disabled type="text" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编号" prop="pwd">
|
||||
<el-input v-model="printForm.material_code" disabled type="text" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前箱标签" prop="pwd">
|
||||
<el-input v-model="printForm.bar_code" disabled type="text" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前打印箱号" prop="pwd">
|
||||
<el-input v-model="printForm.print_no" type="text" style="width: 100px" />
|
||||
<el-button type="primary" @click="resetno">重置箱号</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印标签数量" prop="pwd">
|
||||
<el-input-number v-model="printForm.print_number" type="text" style="width: 100px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">打 印</el-button>
|
||||
</span>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form" :inline="true" :model="form" size="mini" label-width="160px" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;">
|
||||
<el-form-item label="订单号" prop="pwd">
|
||||
<el-input v-model="printForm.sale_id" disabled type="text" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编号" prop="pwd">
|
||||
<el-input v-model="printForm.material_code" disabled type="text" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前箱标签" prop="pwd">
|
||||
<el-input v-model="printForm.bar_code" disabled type="text" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前打印箱号" prop="pwd">
|
||||
<el-input v-model="printForm.print_no" type="text" style="width: 100px" />
|
||||
<el-button type="primary" @click="resetno">重置箱号</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印标签数量" prop="pwd">
|
||||
<el-input-number v-model="printForm.print_num" type="text" style="width: 100px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">打 印</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -310,29 +310,29 @@
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column v-if="false" prop="workorder_id" label="生产班次工单标识"/>
|
||||
<el-table-column prop="workorder_code" label="工单编号" width="140px"/>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="workorder_code" label="工单编号" width="140px" />
|
||||
<el-table-column prop="sale_id" label="订单号" width="140px" />
|
||||
<el-table-column prop="shift_type_scode" label="班次类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.PDM_BI_SHIFTTYPE[scope.row.shift_type_scode] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="workprocedure_code" label="工序编码" />-->
|
||||
<el-table-column prop="product_area" label="生产车间"/>
|
||||
<el-table-column prop="plan_qty" label="计划数量"/>
|
||||
<el-table-column prop="real_qty" label="实际数量"/>
|
||||
<el-table-column prop="person_name" label="生产人员"/>
|
||||
<el-table-column prop="person_real_qty" label="人员实际数量" width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="dq_real_qty" label="电气实际数量" width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="workprocedure_name" label="工序名称" width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_weight" label="物料单重" width="100" :formatter="crud.formatQlNum4"/>
|
||||
<el-table-column prop="planproducestart_date" label="计划开始时间" width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="planproduceend_date" label="计划结束时间" width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="realproducestart_date" label="实际开始时间" width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="realproduceend_date" label="实际结束时间" width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="device_code" label="当前设备编码" width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="product_area" label="生产车间" />
|
||||
<el-table-column prop="plan_qty" label="计划数量" />
|
||||
<el-table-column prop="real_qty" label="实际数量" />
|
||||
<el-table-column prop="person_name" label="生产人员" />
|
||||
<el-table-column prop="person_real_qty" label="人员实际数量" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="dq_real_qty" label="电气实际数量" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="workprocedure_name" label="工序名称" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="material_weight" label="物料单重" width="100" :formatter="crud.formatQlNum4" />
|
||||
<el-table-column prop="planproducestart_date" label="计划开始时间" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="planproduceend_date" label="计划结束时间" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="realproducestart_date" label="实际开始时间" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="realproduceend_date" label="实际结束时间" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="device_code" label="当前设备编码" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="is_canupdate_update" label="操作工是否允许修改报工数量" width="200" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.IS_OR_NOT[scope.row.is_canupdate_update] }}
|
||||
@@ -358,29 +358,29 @@
|
||||
{{ dict.label.IS_OR_NOT[scope.row.is_error] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="error_info" label="异常信息" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注"/>
|
||||
<el-table-column prop="create_name" label="创建人" show-overflow-tooltip/>
|
||||
<el-table-column prop="create_time" label="创建时间" show-overflow-tooltip/>
|
||||
<el-table-column prop="update_name" label="修改人" show-overflow-tooltip/>
|
||||
<el-table-column prop="update_time" label="修改时间" show-overflow-tooltip/>
|
||||
<el-table-column prop="error_info" label="异常信息" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_name" label="创建人" show-overflow-tooltip />
|
||||
<el-table-column prop="create_time" label="创建时间" show-overflow-tooltip />
|
||||
<el-table-column prop="update_name" label="修改人" show-overflow-tooltip />
|
||||
<el-table-column prop="update_time" label="修改时间" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStructattr from '@/api/wms/basedata/st/structattr'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
import crudProduceshiftorder from '@/views/wms/product_manage/workorder/produceshiftorder'
|
||||
import {getLodop} from '@/assets/js/lodop/LodopFuncs'
|
||||
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
||||
import orderExt from '@/views/wms/old_manage/old_package/orderExt'
|
||||
|
||||
const defaultForm = {
|
||||
@@ -431,7 +431,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'Structattr',
|
||||
dicts: ['ST_HEIGHT_TYPE', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'IS_OR_NOT', 'MPS_BD_ORDERSTATUS', 'WORKORDER_CREATE_TYPE', 'PDM_BI_SHIFTTYPE'],
|
||||
components: {pagination, crudOperation, rrOperation, udOperation},
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -447,7 +447,7 @@ export default {
|
||||
},
|
||||
url: 'api/produceWorkorder',
|
||||
idField: 'struct_id',
|
||||
crudMethod: {...crudStructattr}
|
||||
crudMethod: { ...crudStructattr }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
@@ -493,8 +493,16 @@ export default {
|
||||
val[1] = form.sect_id
|
||||
form.cascader = val
|
||||
},
|
||||
submit() {},
|
||||
resetno() {},
|
||||
submit() {
|
||||
this.printNumber()
|
||||
},
|
||||
resetno() {
|
||||
const param = { 'sale_id': this.currentRow.sale_id, 'material_code': this.currentRow.material_code }
|
||||
orderExt.reset(param).then(res => {
|
||||
this.crud.notify('重置成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.dialogVisible = false
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
@@ -536,17 +544,6 @@ export default {
|
||||
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
|
||||
},
|
||||
startWork() {
|
||||
if (!this.crud.query.one_box_package_qty || !this.crud.query.one_package_qty || !this.crud.query.box_type ||
|
||||
!this.crud.query.target_roadway || !this.crud.query.is_flip ||
|
||||
!this.crud.query.tray_full_num) {
|
||||
this.crud.notify('缺少开工必要参数,保证输入框内不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.currentRow.extra_map = this.crud.query
|
||||
this.currentRow.extra_map.package_qty = Math.ceil(this.currentRow.plan_qty / this.currentRow.extra_map.one_package_qty)
|
||||
this.currentRow.extra_map.box_num = Math.ceil(this.currentRow.extra_map.package_qty / this.currentRow.extra_map.one_box_package_qty)
|
||||
orderExt.add(this.currentRow).then(res => {
|
||||
})
|
||||
crudProduceshiftorder.openStart(this.currentRow).then(res => {
|
||||
})
|
||||
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
@@ -584,37 +581,46 @@ export default {
|
||||
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
printFormm(){
|
||||
const param ={"sale_id":this.currentRow.sale_id,"material_code":this.currentRow.material_code}
|
||||
printFormm() {
|
||||
const parse = JSON.parse(this.currentRow.package_ext)
|
||||
const flip = parse.is_flip
|
||||
const target_roadway = parse.target_roadway
|
||||
const workorderCode = this.currentRow.workorder_code
|
||||
const param = { 'workorder_code': workorderCode, 'is_flip': flip, 'target_roadway': target_roadway, 'sale_id': this.currentRow.sale_id, 'material_code': this.currentRow.material_code }
|
||||
orderExt.getQuery(param).then(res => {
|
||||
this.printForm = res
|
||||
})
|
||||
},
|
||||
close(){
|
||||
this.printForm = {},
|
||||
this.dialogVisible =false
|
||||
close() {
|
||||
this.printForm = {},
|
||||
this.dialogVisible = false
|
||||
},
|
||||
print(){
|
||||
this.dialogVisible =true
|
||||
print() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
printNumber(){
|
||||
printNumber() {
|
||||
const parse = JSON.parse(this.currentRow.package_ext)
|
||||
this.currentRow.print_num = this.printForm.print_num
|
||||
this.currentRow.is_flip = parse.is_flip
|
||||
this.currentRow.target_roadway = parse.target_roadway
|
||||
orderExt.getExtList(this.currentRow).then(res => {
|
||||
if (res.length == 0 || !res) {
|
||||
this.crud.notify('该工单需要打印的箱数为0', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
debugger
|
||||
res.forEach((item) => {
|
||||
console.log(item)
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '50mm', '')
|
||||
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '48mm', '28mm', 0, 1)
|
||||
LODOP.ADD_PRINT_BARCODE('10mm', '12mm', '60mm', '25mm', '128Auto', item.bar_code)
|
||||
LODOP.ADD_PRINT_BARCODE('10mm', '12mm', '60mm', '25mm', '128Auto', item)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
||||
LODOP.ADD_PRINT_TEXT('35mm', '22mm', '40mm', '20mm', item.bar_code.substring(0, 9))
|
||||
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
|
||||
LODOP.ADD_PRINT_TEXT('42mm', '25mm', '40mm', '20mm', item.bar_code.substring(9, 16))
|
||||
console.log(item.barcode)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 20)
|
||||
LODOP.PRINT()// 打印
|
||||
// LODOP.PREVIEW()
|
||||
|
||||
@@ -22,6 +22,12 @@ export function getQuery(data) {
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
} export function reset(data) {
|
||||
return request({
|
||||
url: 'api/mpsSaleOrderIcExt/reset',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, getExtList, getQuery }
|
||||
export default { add, getExtList, getQuery, reset }
|
||||
|
||||
@@ -365,7 +365,7 @@
|
||||
clearable
|
||||
size="mini"
|
||||
style="width: 200px;"
|
||||
@change="getNotWorkDeviceByWorkproceduceId(form.workprocedure_id)"
|
||||
@change="getWorkDeviceByWorkproceduceId(form.workprocedure_id)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workprocedureListArea"
|
||||
@@ -391,7 +391,15 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="crud.status.edit" label="工单下发顺序">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="form.aps_workorder_no"
|
||||
style="width: 200px;"
|
||||
>
|
||||
</el-input-number>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售单号">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
@@ -1126,8 +1134,8 @@ export default {
|
||||
tableChanged3() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
getNotWorkDeviceByWorkproceduceId(workprocedure_id) { // 根据工序标识获取设备列表
|
||||
crudProduceshiftorder.getNotWorkDeviceByWorkproceduceId({
|
||||
getWorkDeviceByWorkproceduceId(workprocedure_id) { // 根据工序标识获取设备列表
|
||||
crudProduceshiftorder.getWorkDeviceByWorkproceduceId({
|
||||
workprocedure_id: workprocedure_id,
|
||||
product_area: this.form.product_area
|
||||
}).then(res => {
|
||||
|
||||
@@ -144,6 +144,13 @@ export function getNotWorkDeviceByWorkproceduceId(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getWorkDeviceByWorkproceduceId(data) {
|
||||
return request({
|
||||
url: 'api/produceWorkorder/getWorkDeviceByWorkproceduceId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function replaceDevice(data) {
|
||||
return request({
|
||||
@@ -245,6 +252,7 @@ export default {
|
||||
reportQuery3,
|
||||
excelImport,
|
||||
getNotWorkDeviceByWorkproceduceId,
|
||||
getWorkDeviceByWorkproceduceId,
|
||||
replaceDevice,
|
||||
submitAdjustWorkOrder,
|
||||
queryAdjustWorkOrder,
|
||||
|
||||
Reference in New Issue
Block a user