设备代码提交

dev2.0
郑明梁 2 years ago
parent 20b6055f1b
commit af21cfdf13

@ -272,7 +272,7 @@ public class InvProductController extends BaseController {
*/
@GetMapping("/spms/inv/product/getInvMAProducts")
public BaseResponse getInvMAProducts(FilterInvProductRequest filterInvProductRequest) {
if (null == filterInvProductRequest || StrUtil.isBlank(filterInvProductRequest.getInvCode())) {
if (null == filterInvProductRequest) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
List<InvProductResponse> list = invProductService.getInvMAProducts(filterInvProductRequest);

@ -108,4 +108,7 @@ public class DeviceReceiveOrderEntity {
@TableField(value = "remark")
private String remark;
@TableField(value = "type")
private String type;
}

@ -45,4 +45,6 @@ public class AddDeviceReceiveOrderDetailRequest {
*/
private String supId;
private Integer type;
}

@ -88,6 +88,11 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService {
// deviceDetail.setCreateTime(date);
// deviceDetail.setUpdateTime(date);
deptDeviceDetailDao.insert(deviceDetail);
}else{
DeptDeviceDetailEntity deptDeviceDetailEntity = deptDeviceDetailDao.selectOne(new QueryWrapper<DeptDeviceDetailEntity>().eq("deptCode", receiveOrderEntity.getFromDeptCode()));
deptDeviceDetailEntity.setDeptCode(receiveOrderEntity.getFromDeptCode());
deptDeviceDetailEntity.setCreateUser(receiveOrderEntity.getAuditUser());
deptDeviceDetailDao.updateById(deptDeviceDetailEntity);
}
}
return ResultVOUtils.success("添加成功");

@ -7,11 +7,13 @@ import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantType;
import com.glxp.api.dao.inv.DeptDeviceDetailDao;
import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao;
import com.glxp.api.dao.inv.InvProductDao;
import com.glxp.api.dao.inv.InvProductDetailDao;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.inv.DeptDeviceDetailEntity;
import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity;
import com.glxp.api.entity.inv.InvProductDetailEntity;
import com.glxp.api.entity.inv.InvProductEntity;
@ -22,6 +24,7 @@ import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse;
import com.glxp.api.service.basic.UdiProductService;
import com.glxp.api.service.inv.DeptDeviceDetailService;
import com.glxp.api.service.inv.DeviceReceiveOrderDetailService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.udi.FilterUdiUtils;
@ -48,6 +51,8 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
private SystemParamConfigService systemParamConfigService;
@Resource
private UdiProductService udiProductService;
@Resource
private DeptDeviceDetailDao deptDeviceDetailDao;
@Override
public List<DeviceReceiveOrderDetailResponse> filterList(FilterDeviceReceiveOrderDetailRequest detailRequest) {
@ -106,7 +111,7 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
deviceReceiveOrderDetailDao.insert(orderDetail);
} else {
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product");
if(systemParamConfigEntity.getParamValue().equals("0")){
if(systemParamConfigEntity.getParamValue().equals("0") || addDetailRequest.getType() == 1){
//通过选库存添加
//查询选中的库存信息
for (String invProductId : addDetailRequest.getInvProductIds()) {
@ -116,7 +121,7 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
//插入设备领用记录详情
deviceReceiveOrderDetailDao.insert(orderDetail);
}
}else{
}else if(systemParamConfigEntity.getParamValue().equals("1") || addDetailRequest.getType() == 3 ){
for (String invProductId : addDetailRequest.getInvProductIds()) {
DeviceReceiveOrderDetailEntity deviceReceiveOrderDetailEntity = new DeviceReceiveOrderDetailEntity();
@ -131,6 +136,27 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
deviceReceiveOrderDetailDao.insert(deviceReceiveOrderDetailEntity);
}
}else if(addDetailRequest.getType() == 2){
for (String invProductId : addDetailRequest.getInvProductIds()) {
DeviceReceiveOrderDetailEntity deviceReceiveOrderDetailEntity = new DeviceReceiveOrderDetailEntity();
DeptDeviceDetailEntity deptDeviceDetailEntity= deptDeviceDetailDao.selectById(invProductId);
//查询库存详情
deviceReceiveOrderDetailEntity.setNameCode(deptDeviceDetailEntity.getNameCode());
deviceReceiveOrderDetailEntity.setRelId(Long.valueOf(deptDeviceDetailEntity.getRelId()));
deviceReceiveOrderDetailEntity.setOriginCode(deptDeviceDetailEntity.getOriginCode());
deviceReceiveOrderDetailEntity.setCode(deptDeviceDetailEntity.getCode());
deviceReceiveOrderDetailEntity.setOrderIdFk(addDetailRequest.getOrderIdFk());
deviceReceiveOrderDetailEntity.setSupId(deptDeviceDetailEntity.getSupId());
deviceReceiveOrderDetailEntity.setBatchNo(deptDeviceDetailEntity.getBatchNo());
deviceReceiveOrderDetailEntity.setProductionDate(deptDeviceDetailEntity.getProductionDate());
deviceReceiveOrderDetailEntity.setExpireDate(deptDeviceDetailEntity.getExpireDate());
deviceReceiveOrderDetailEntity.setSerialNo(deptDeviceDetailEntity.getSerialNo());
deviceReceiveOrderDetailEntity.setCreateTime(new Date());
deviceReceiveOrderDetailEntity.setUpdateTime(new Date());
deviceReceiveOrderDetailDao.insert(deviceReceiveOrderDetailEntity);
}
}
}
return ResultVOUtils.success("添加成功!");

@ -0,0 +1,22 @@
package com.glxp.api.util;
import java.util.ArrayList;
import java.util.List;
public class test {
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("1");
list.add("2");
list.add("3");
list.add("4");
list.add("5");
list.add("6");
list.add("7");
for (int i =0; i<20;i++){
String ys =list.get(i%7);
System.out.println(ys);
}
}
}

@ -265,3 +265,4 @@ CALL Pro_Temp_ColumnWork('dept_device_detail', 'nameCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('device_inspect_plan', 'executeCount', 'int', 1);
CALL Pro_Temp_ColumnWork('device_inspect_plan', 'useFrequency', 'int', 1);
CALL Pro_Temp_ColumnWork('device_receive_order', 'type', 'int', 1);

Loading…
Cancel
Save