Browse Source

155接口后台逻辑&数据库连接fix

master
psh 5 months ago
parent
commit
ec78e9dd8b
  1. 2
      acs/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml
  2. 2
      acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml
  3. 33
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java
  4. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Request.java
  5. 25
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155RequestBody.java
  6. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Response.java
  7. 48
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155ResponseBody.java
  8. 61
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/controller/WorkorderController.java
  9. 34
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/IWorkorderService.java
  10. 45
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/dao/Workorder.java
  11. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/dao/mapper/WorkorderMapper.java
  12. 25
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/dto/WorkorderDto.java
  13. 21
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/dto/WorkorderQuery.java
  14. 53
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/impl/WorkorderServiceImpl.java
  15. 2
      lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml
  16. 2
      lms/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml

2
acs/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

@ -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.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:gc_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:gc_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root}
# password: ${DB_PWD:Root.123456}
password: ${DB_PWD:123456}

2
acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml

@ -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.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:gc_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:gc_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root}
# password: ${DB_PWD:Root.123456}
password: ${DB_PWD:123456}

33
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java

@ -18,6 +18,8 @@ import org.nl.wms.sch.material.service.dao.Material;
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper;
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper;
import org.nl.wms.sch.workorder.controller.service.IWorkorderService;
import org.nl.wms.sch.workorder.controller.service.dao.Workorder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpStatus;
@ -48,6 +50,9 @@ public class MesController {
@Autowired
private IPdmBdWorkorderService pdmBdWorkorderService;
@Autowired
private IWorkorderService workorderService;
@PostMapping("/QPMES060")
@Log(value = "QPMES060")
@ApiOperation("QPMES060")
@ -166,4 +171,32 @@ public class MesController {
log.info("QPMES118服务被调用{}",qpmes118Response.toString());
return qpmes118Response;
}
@PostMapping("/QPMES155")
@Log(value = "QPMES155")
@ApiOperation("QPMES155")
@SaIgnore
public QPMES155Response QPMES155(@RequestBody JSONObject notice) {
log.info("QPMES155服务被调用,输入参数:" + notice.toString());
QPMES155Response qpmes155Response =new QPMES155Response();
QPMES155Request qpmes155Request=notice.toJavaObject(QPMES155Request.class);
log.info(qpmes155Request.toString());
for(QPMES155RequestBody temp:qpmes155Request.getBODY()){
try{
Workorder workorder =new Workorder();
workorder.copyFrom(temp);
workorderService.create(workorder);
}catch (Exception e){
log.error("工单已存在导致新增失败,{}{}",e,e.getMessage());
}
}
Head head=new Head();
head.setDEST_SYSTEM("WMS");
head.setINTF_ID("QPMES155");
head.setSRC_MSGID(IdUtil.simpleUUID());
head.setSRC_SYSTEM("AGV");
qpmes155Response.setHEAD(head);
log.info("QPMES155服务被调用{}",qpmes155Response.toString());
return qpmes155Response;
}
}

19
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Request.java

@ -0,0 +1,19 @@
package org.nl.wms.mes.domain;
import lombok.*;
import lombok.experimental.Accessors;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
@Data
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@XmlRootElement
@Accessors(chain = true)
public class QPMES155Request {
private Head HEAD;
private List<QPMES155RequestBody> BODY;
}

25
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155RequestBody.java

@ -0,0 +1,25 @@
package org.nl.wms.mes.domain;
import lombok.Data;
import java.util.List;
@Data
public class QPMES155RequestBody {
//出库单号
private String somtOrderNo;
//生产工单
private String moname;
//托号
private String palletSN;
//晶棒号
private String lotSN;
//物料编码
private String productName;
//物料描述
private String productDescription;
//客户编码
private String supplierCode;
//客户名称
private String supplierName;
}

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Response.java

@ -0,0 +1,17 @@
package org.nl.wms.mes.domain;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.ToString;
import java.util.List;
@Data
@ToString
public class QPMES155Response {
@JSONField(name = "HEAD")
private Head HEAD;
@JSONField(name = "BODY")
private List<QPMES155ResponseBody> BODY;
}

48
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155ResponseBody.java

@ -0,0 +1,48 @@
package org.nl.wms.mes.domain;
import lombok.Data;
@Data
public class QPMES155ResponseBody {
//消息状态
private String STATUS;
//消息文本
private String MESSAGE;
//预留主键1
private String KEY_VALUE01;
//预留主键2
private String KEY_VALUE02;
//预留主键3
private String KEY_VALUE03;
//预留主键4
private String KEY_VALUE04;
//预留主键5
private String KEY_VALUE05;
//预留主键6
private String KEY_VALUE06;
//预留主键7
private String KEY_VALUE07;
//预留主键8
private String KEY_VALUE08;
//预留主键9
private String KEY_VALUE09;
//预留反馈主键1
private String FKEY_VALUE01;
//预留反馈主键2
private String FKEY_VALUE02;
//预留反馈主键3
private String FKEY_VALUE03;
//预留反馈主键4
private String FKEY_VALUE04;
//预留反馈主键5
private String FKEY_VALUE05;
//预留反馈主键6
private String FKEY_VALUE06;
//预留反馈主键7
private String FKEY_VALUE07;
//预留反馈主键8
private String FKEY_VALUE08;
//预留反馈主键9
private String FKEY_VALUE09;
}

61
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/controller/WorkorderController.java

@ -0,0 +1,61 @@
package org.nl.wms.sch.workorder.controller.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.sch.workorder.controller.service.IWorkorderService;
import org.nl.wms.sch.workorder.controller.service.dao.Workorder;
import org.nl.wms.sch.workorder.controller.service.dto.WorkorderQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Set;
/**
* @author lyd
* @date 2023-05-16
**/
@Slf4j
@RestController
@Api(tags = "托盘出库工单管理")
@RequestMapping("/api/workorder")
public class WorkorderController {
@Autowired
private IWorkorderService workorderService;
@GetMapping
@Log("查询托盘出库工单")
@ApiOperation("查询托盘出库工单")
//@SaCheckPermission("@el.check('material:list')")
public ResponseEntity<Object> query(WorkorderQuery whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(workorderService.queryAll(whereJson,page)),HttpStatus.OK);
}
@PostMapping
@Log("新增托盘出库工单")
@ApiOperation("新增托盘出库工单")
//@SaCheckPermission("@el.check('material:add')")
public ResponseEntity<Object> create(@Validated @RequestBody Workorder entity){
workorderService.create(entity);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@Log("删除托盘出库工单")
@ApiOperation("删除托盘出库工单")
//@SaCheckPermission("@el.check('material:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
workorderService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

34
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/IWorkorderService.java

@ -0,0 +1,34 @@
package org.nl.wms.sch.workorder.controller.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.sch.workorder.controller.service.dao.Workorder;
import org.nl.wms.sch.workorder.controller.service.dto.WorkorderQuery;
import java.util.Set;
public interface IWorkorderService extends IService<Workorder> {
/**
* 查询数据分页
* @param whereJson 条件
* @param pageable 分页参数
* @return IPage<Workorder>
*/
IPage<Workorder> queryAll(WorkorderQuery whereJson, PageQuery pageable);
/**
* 创建
* @param entity /
*/
void create(Workorder entity);
/**
* 多选删除
* @param ids /
*/
void deleteAll(Set<String> ids);
}

45
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/dao/Workorder.java

@ -0,0 +1,45 @@
package org.nl.wms.sch.workorder.controller.service.dao;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.nl.wms.mes.domain.QPMES155RequestBody;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@ToString
@TableName("pdm_bd_workorder_two")
public class Workorder implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "出库单号")
private String somtOrderNo;
@ApiModelProperty(value = "生产工单")
private String moname;
@ApiModelProperty(value = "托号")
private String palletSN;
@ApiModelProperty(value = "晶棒号")
private String lotSN;
@ApiModelProperty(value = "物料编码")
private String productName;
@ApiModelProperty(value = "物料描述")
private String productDescription;
@ApiModelProperty(value = "客户编码")
private String supplierCode;
@ApiModelProperty(value = "客户名称")
private String supplierName;
@ApiModelProperty(value = "入库类型0-新建,1-已出库")
private Integer status;
@ApiModelProperty(value = "创建时间")
private Date createTime;
public void copyFrom(QPMES155RequestBody source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}
}

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/dao/mapper/WorkorderMapper.java

@ -0,0 +1,12 @@
package org.nl.wms.sch.workorder.controller.service.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.wms.sch.workorder.controller.service.dao.Workorder;
/**
* @author lyd
* @date 2023-05-16
**/
public interface WorkorderMapper extends BaseMapper<Workorder> {
}

25
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/dto/WorkorderDto.java

@ -0,0 +1,25 @@
package org.nl.wms.sch.workorder.controller.service.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class WorkorderDto implements Serializable {
//出库单号
private String somtOrderNo;
//生产工单
private String moname;
//托号
private String palletSN;
//晶棒号
private String lotSN;
//物料编码
private String productName;
//物料描述
private String productDescription;
//客户编码
private String supplierCode;
//客户名称
private String supplierName;
}

21
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/dto/WorkorderQuery.java

@ -0,0 +1,21 @@
package org.nl.wms.sch.workorder.controller.service.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class WorkorderQuery implements Serializable {
//托盘号
private String palletSN;
//物料条码号
private String lotSN;
//物料名称
private String productName;
//供应商编码
private String productDescription;
//供应商名称
private String supplierCode;
//绑定状态
private String status;
}

53
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/controller/service/impl/WorkorderServiceImpl.java

@ -0,0 +1,53 @@
package org.nl.wms.sch.workorder.controller.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.sch.workorder.controller.service.IWorkorderService;
import org.nl.wms.sch.workorder.controller.service.dao.Workorder;
import org.nl.wms.sch.workorder.controller.service.dao.mapper.WorkorderMapper;
import org.nl.wms.sch.workorder.controller.service.dto.WorkorderQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Set;
@Slf4j
@Service
public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder> implements IWorkorderService {
@Autowired
private WorkorderMapper workorderMapper;
@Override
public IPage<Workorder> queryAll(WorkorderQuery whereJson, PageQuery page){
IPage<Workorder> pages = new Page<>(page.getPage() + 1, page.getSize());
LambdaQueryWrapper<Workorder> wrapper = new LambdaQueryWrapper<>();
wrapper.like(StringUtils.isNotBlank(whereJson.getPalletSN()), Workorder::getPalletSN,whereJson.getPalletSN());
wrapper.like(StringUtils.isNotBlank(whereJson.getLotSN()), Workorder::getLotSN,whereJson.getLotSN());
wrapper.like(StringUtils.isNotBlank(whereJson.getProductName()), Workorder::getProductName,whereJson.getProductName());
wrapper.like(StringUtils.isNotBlank(whereJson.getSupplierCode()), Workorder::getSupplierCode,whereJson.getSupplierCode());
wrapper.like(StringUtils.isNotBlank(whereJson.getProductDescription()), Workorder::getProductDescription,whereJson.getProductDescription());
wrapper.like(StringUtils.isNotBlank(whereJson.getStatus()), Workorder::getStatus,whereJson.getStatus());
pages = workorderMapper.selectPage(pages, wrapper);
return pages;
}
@Override
public void create(Workorder entity) {
workorderMapper.insert(entity);
}
@Override
public void deleteAll(Set<String> ids) {
// 真删除
workorderMapper.deleteBatchIds(ids);
}
}

2
lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

@ -6,7 +6,7 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:gc_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:gc_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:stand_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root}
password: ${DB_PWD:123456}

2
lms/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml

@ -6,7 +6,7 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:gc_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:gc_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:stand_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root}
password: ${DB_PWD:123456}

Loading…
Cancel
Save