Commit 98d2de97 by vanga

package to jinko

parent 4de020e6
......@@ -130,7 +130,7 @@ public class AccyOutServiceImpl implements AccyOutService {
@Override
public AccessoryMaterialInfo getByMaterialCode(String materialCode) {
try {
Result<AccessoryMaterialDto> result = ybFeignClients.getByMaterialCode(materialCode);
Result<AccessoryMaterialDto> result = ybFeignClients.getByMaterialCodes(materialCode);
Integer code = result.getCode();
AccessoryMaterialDto materialModelDto = result.getData();
if (code != 200 || materialModelDto == null) {
......@@ -142,6 +142,21 @@ public class AccyOutServiceImpl implements AccyOutService {
}
}
@Override
public AccessoryMaterialInfo getByMaterialCodes(String materialCode) {
try {
Result<AccessoryMaterialDto> result = ybFeignClients.getByMaterialCodes(materialCode);
Integer code = result.getCode();
AccessoryMaterialDto materialModelDto = result.getData();
if (code != 200 || materialModelDto == null) {
throw new BusinessException("根据物料编码【" + materialCode + "】获取辅材信息失败,状态码:" + code + ",反馈信息:" + result.getMessage());
}
return this.setAccessoryMaterialInfos(materialModelDto);
} catch (Exception e) {
throw new BusinessException("根据物料编码【" + materialCode + "】获取辅材信息异常," + e.getMessage());
}
}
private AccessoryMaterialInfo setAccessoryMaterialInfo(AccessoryMaterialDto materialModelDto) {
AccessoryMaterialInfo accessoryMaterialInfo = new AccessoryMaterialInfo();
accessoryMaterialInfo.setMaterialId(Long.valueOf(materialModelDto.getId()));
......@@ -160,7 +175,24 @@ public class AccyOutServiceImpl implements AccyOutService {
accessoryMaterialInfo.setUnit(materialModelDto.getUnitName());
return accessoryMaterialInfo;
}
private AccessoryMaterialInfo setAccessoryMaterialInfos(AccessoryMaterialDto materialModelDto) {
AccessoryMaterialInfo accessoryMaterialInfo = new AccessoryMaterialInfo();
accessoryMaterialInfo.setMaterialId(Long.valueOf(materialModelDto.getMaterialModelId()));
accessoryMaterialInfo.setMaterialType(materialModelDto.getModelType());
accessoryMaterialInfo.setMaterialName(materialModelDto.getName());
accessoryMaterialInfo.setMaterialCode(materialModelDto.getCodes());
accessoryMaterialInfo.setWarning(materialModelDto.getWarning());
accessoryMaterialInfo.setWarnTime(materialModelDto.getWarnTime());
accessoryMaterialInfo.setUseLife(materialModelDto.getUseLife());
//TODO 寿命类型字段,先默认为0,标识按照炉次
accessoryMaterialInfo.setLifeType(0);
accessoryMaterialInfo.setSupplier(materialModelDto.getSupplier());
accessoryMaterialInfo.setSpecification(materialModelDto.getSpecification());
accessoryMaterialInfo.setXh("");
accessoryMaterialInfo.setTh("");
accessoryMaterialInfo.setUnit(materialModelDto.getUnitName());
return accessoryMaterialInfo;
}
private WarehouseInputBillBo newInputBill(Accessory accessory, String reason) {
WarehouseInputBillBo inputBill = new WarehouseInputBillBo();
inputBill.setType("辅料退库");
......@@ -174,7 +206,7 @@ public class AccyOutServiceImpl implements AccyOutService {
dto.setBatchNo(accessory.getBatchCode());
dto.setCount(new BigDecimal(accessory.getNumber()));
//TODO 字段需要与物料主数据对齐
AccessoryMaterialInfo materialModel = this.getByMaterialCode(accessory.getMaterialCode());
AccessoryMaterialInfo materialModel = this.getByMaterialCodes(accessory.getMaterialCode());
Assert.notNull(materialModel, "【" + accessory.getMaterialCode() + "】物料主数据不存在,请检查数据!");
dto.setMaterialModelId(materialModel.getMaterialId());
dto.setMaterialModelCode(materialModel.getMaterialCode());
......@@ -200,7 +232,7 @@ public class AccyOutServiceImpl implements AccyOutService {
//组装物料明细数据,出库时,出库请求方只需要传递物料号和出库数量即可,具体的出库逻辑由真正出库时处理
String materialCode = applyAccessoryParam.getMaterialCode();
//TODO 字段需要与物料主数据对齐
AccessoryMaterialInfo materialModel = this.getByMaterialCode(materialCode);
AccessoryMaterialInfo materialModel = this.getByMaterialCodes(materialCode);
Assert.notNull(materialModel, "【" + materialCode + "】物料主数据不存在,请检查数据!");
dto.setMaterialModelId(materialModel.getMaterialId());
dto.setMaterialModelCode(materialCode);
......
......@@ -4,12 +4,19 @@ import com.sw.common.accessory.api.feignCilent.YbFeignClients;
import com.sw.common.accessory.api.model.AccessoryMaterialDto;
import com.sw.common.accessory.api.model.EquipmentDto;
import com.sw.common.accessory.api.model.MaterialModelDto;
import com.sw.common.accessory.server.dto.DictionaryItemDto;
import com.sw.common.accessory.server.dto.ReportSapGoodsmvtDto;
import com.sw.common.accessory.server.dto.ReportSapWorkinghoursDto;
import com.sw.common.core.response.Result;
import com.sw.common.core.response.ResultCode;
import com.sw.common.core.response.ResultGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid;
import java.util.List;
@Slf4j
@Component
......@@ -24,14 +31,49 @@ public class YbFeignClientsFallback implements FallbackFactory<YbFeignClients> {
}
@Override
public Result<AccessoryMaterialDto> getByMaterialCodes(String materialCode) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【根据物料编码:" + materialCode + "查询物料主数据】接口失败:" + throwable.getMessage());
}
@Override
public Result<AccessoryMaterialDto> getByMaterialId(Long materialId) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【根据物料ID:" + materialId + "查询物料主数据】接口失败:" + throwable.getMessage());
}
@Override
public Result<EquipmentDto> getByCodeDto(String equipmentCode) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【根据设备编码:" + equipmentCode + "查询物料主数据】接口失败:" + throwable.getMessage());
}
@Override
public Result<EquipmentDto> getEquipmentInfo(String equipmentCode) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【根据设备编码:" + equipmentCode + "查询物料主数据】接口失败:" + throwable.getMessage());
}
@Override
public Result sendSapGoodsmvt(@Valid ReportSapGoodsmvtDto reportSapGoodsmvtDto) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【报工】接口失败:" + throwable.getMessage());
}
@Override
public Result sendSapWorkinghours(ReportSapWorkinghoursDto ReportSapWorkinghoursDto) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【报工工时】接口失败:" + throwable.getMessage());
}
@Override
public Result<DictionaryItemDto> findByThemeValueAndNameAndValueAndEnable(String themeValue, String name, String value, boolean enable) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【根据字段主题和词条名称查询字典词条】接口失败:" + throwable.getMessage());
}
@Override
public Result getDeviceId(Long id) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【设备类型根据设备编码获取】接口失败:" + throwable.getMessage());
}
@Override
public Result<List<EquipmentDto>> findByDeviceId(Integer deviceId) {
return ResultGenerator.fail(ResultCode.ESERVER.getCode(), "调用【根据类型id获取所有设备】接口失败:" + throwable.getMessage());
}
};
}
}
......@@ -3,13 +3,18 @@ package com.sw.common.accessory.api.feignCilent;
import com.sw.common.accessory.api.fallBackFactory.YbFeignClientsFallback;
import com.sw.common.accessory.api.model.AccessoryMaterialDto;
import com.sw.common.accessory.api.model.EquipmentDto;
import com.sw.common.accessory.api.model.MaterialModelDto;
import com.sw.common.accessory.config.FeignConfig;
import com.sw.common.accessory.server.dto.DeviceDto;
import com.sw.common.accessory.server.dto.DictionaryItemDto;
import com.sw.common.accessory.server.dto.ReportSapGoodsmvtDto;
import com.sw.common.accessory.server.dto.ReportSapWorkinghoursDto;
import com.sw.common.core.response.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
@FeignClient(name = "mes-pc-server", configuration = {FeignConfig.class}, fallbackFactory = YbFeignClientsFallback.class)
......@@ -20,7 +25,8 @@ public interface YbFeignClients {
*/
@GetMapping(value = "/accessoryMaterial/getByMaterialCode", headers = "token=token_admin")
Result<AccessoryMaterialDto> getByMaterialCode(@RequestParam("materialCode") String materialCode);
@GetMapping(value = "/accessoryMaterial/getByMaterialCodes", headers = "token=token_admin")
Result<AccessoryMaterialDto> getByMaterialCodes(@RequestParam("materialCode") String materialCode);
/**
* 根据物料id查询辅料相关信息
*/
......@@ -32,5 +38,28 @@ public interface YbFeignClients {
*/
@GetMapping(value = "/init/equipment/getByCode", headers = "token=token_admin")
Result<EquipmentDto> getEquipmentInfo(@RequestParam("equipmentCode") String equipmentCode);
@ApiOperation(value = "根据设备编码查询设备信息")
@GetMapping("/init/equipment/getByCodeDto")
Result<EquipmentDto> getByCodeDto(@RequestParam("equipmentCode") String equipmentCode);
@ApiOperation(value = "报工接口")
@PostMapping("/sap/goodsmvt/create")
Result sendSapGoodsmvt(@Valid @RequestBody ReportSapGoodsmvtDto reportSapGoodsmvtDto);
@ApiOperation(value = "工时报工接口")
@PostMapping("/sap/workinghours/create")
Result sendSapWorkinghours(@Valid @RequestBody ReportSapWorkinghoursDto ReportSapWorkinghoursDto);
@ApiOperation(value = "根据字段主题和词条名称查询字典词条")
@GetMapping("/dictionaryItem/findByThemeValueAndNameAndValueAndEnable")
Result<DictionaryItemDto> findByThemeValueAndNameAndValueAndEnable(@RequestParam String themeValue,
@RequestParam String name,
@RequestParam String value,
@RequestParam boolean enable);
@ApiOperation(value = "设备类型根据设备类型Id获取")
@GetMapping(value = "/init/device/getDeviceId")
Result<DeviceDto> getDeviceId(@RequestParam("id") Long id);
@ApiOperation(value = "根据类型id获取所有设备")
@GetMapping("/init/equipment/findByDeviceId")
Result<List<EquipmentDto>> findByDeviceId(@RequestParam("deviceId") Integer deviceId);
}
......@@ -74,7 +74,7 @@ public class AccessoryMaterialDto {
@ApiModelProperty(value = "额定寿命", required = true)
private Double useLife;
@ApiModelProperty(value = "寿命单位", required = true)
private Integer unitOfLife;
private String unitOfLife;
@ApiModelProperty(value = "是否预警", required = true)
private Boolean warning;
......
......@@ -16,6 +16,7 @@ import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "创建设备Dto")
public class EquipmentDto {
Long id;
@ApiModelProperty("设备名称")
@NotNull(message = "设备名称,不能为空")
String name;
......
......@@ -74,14 +74,22 @@ public class EquipmentAccessoryController {
@ApiOperation(value = "申请辅材")
@PostMapping("/applyAccessory")
public Result<String> applyAccessory(@RequestBody @Valid @ApiParam(value = "申请辅材") ApplyAccessoryParamDto applyAccessoryParamDto, BindingResult bindingResult) {
public Result applyAccessory(@RequestBody @Valid @ApiParam(value = "申请辅材") ApplyAccessoryParamDto applyAccessoryParamDto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultGenerator.fail(bindingResult.getFieldError().getDefaultMessage());
}
equipmentAccessoryService.applyAccessory(applyAccessoryParamDto);
return ResultGenerator.success();
}
@ApiOperation(value = "要料申请辅材")
@PostMapping("/applyMaterial")
public Result applyMaterial(@RequestBody @ApiParam(value = "要料申请辅材") ApplyMaterialParamDto materialParamDto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultGenerator.fail(bindingResult.getFieldError().getDefaultMessage());
}
equipmentAccessoryService.applyMaterial(materialParamDto);
return ResultGenerator.success();
}
@ApiOperation(value = "退库")
@PostMapping("/stockReturn")
public Result<String> stockReturn(@RequestBody @Valid @ApiParam(value = "申请辅材") StockReturn stockReturn, BindingResult bindingResult) {
......
package com.sw.common.accessory.server.controller;
import com.sw.common.accessory.server.dto.PartDto;
import com.sw.common.accessory.server.entity.Part;
import com.sw.common.accessory.server.service.PartService;
import com.sw.common.core.context.BaseContextHandler;
import com.sw.common.core.request.RequestPage;
import com.sw.common.core.response.ResponsePage;
import com.sw.common.core.response.Result;
import com.sw.common.core.response.ResultGenerator;
import com.sw.common.mybatisplus.entity.Page;
import com.sw.common.mybatisplus.utils.DynamicSpecifications;
import com.sw.common.mybatisplus.utils.PageUtil;
import com.sw.common.mybatisplus.utils.Specification;
import io.reactivex.rxjava3.internal.util.BackpressureHelper;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.ServletRequest;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/part")
@Slf4j
@Api(tags = "热场部位维护接口")
public class PartController {
@Autowired
private PartService partService;
@ApiOperation(value = "分页查热场部位维护列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "page", value = "页码", dataType = "integer", paramType = "query"),
})
@GetMapping("/listByPage")
public Result<ResponsePage<PartDto>> listByPage(ServletRequest request, @ApiIgnore RequestPage requestPage) {
Specification<Part> specification = DynamicSpecifications.bySearchFilter(request, Part.class);
Page<Part> page = partService.findByExample(specification, PageUtil.createPageable(requestPage));
List<PartDto> dtos = page.getContent().stream()
.map(this::toLazyDto)
.collect(Collectors.toList());
ResponsePage<PartDto> responsePage = new ResponsePage<>(dtos, page.getTotalElements());
return ResultGenerator.success(responsePage);
}
@ApiOperation(value = "获取所有部位维护记录")
@GetMapping("/listAll")
public Result<List<PartDto>> listAll(ServletRequest request) {
Specification<Part> specification = DynamicSpecifications.bySearchFilter(request, Part.class);
List<Part> parts = partService.findByExampleSort(specification, null);
List<PartDto> partDtos = parts.stream()
.map(this::toLazyDto)
.collect(Collectors.toList());
return ResultGenerator.success(partDtos);
}
@ApiOperation(value = "通过id获取部位维护信息")
@GetMapping("/{id}")
public Result<PartDto> get(@PathVariable @ApiParam(value = "所有部位维护id") Long id) {
Part part = partService.get(id);
if (null == part) {
return ResultGenerator.fail("该辅料申请记录不存在");
}
return ResultGenerator.success(toEagerDto(part));
}
@ApiOperation(value = "通过编码获取部位维护信息")
@GetMapping("/partCode")
public Result<PartDto> getPartCode(@RequestParam @ApiParam(value = "部位编码") String partCode) {
Part part = partService.getByPartCode(partCode);
if (null == part) {
return ResultGenerator.fail("该辅料申请记录不存在");
}
return ResultGenerator.success(toEagerDto(part));
}
@ApiOperation(value = "创建部位")
@PostMapping("/create")
public Result<String> create(@RequestBody @Valid @ApiParam(value = "所有部位维护对象") PartDto partDto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultGenerator.fail(bindingResult.getFieldError().getDefaultMessage());
}
Part partCode = partService.getByPartCode(partDto.getPartCode());
if(!ObjectUtils.isEmpty(partCode)){
return ResultGenerator.fail("该数据已存在!");
}
Part part = fromDto(partDto);
part.setCreateBy(BaseContextHandler.getUsername());
part.setCreateTime(new Date());
partService.saveOrUpdate(part);
return ResultGenerator.success();
}
@ApiOperation(value = "更新部位记录")
@PostMapping("/update")
public Result<String> update(@RequestBody @Valid @ApiParam(value = "所有部位维护记录") PartDto dto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultGenerator.fail(bindingResult.getFieldError().getDefaultMessage());
}
try {
Part partCode = partService.getByPartCode(dto.getPartCode());
if(ObjectUtils.isEmpty(partCode)){
return ResultGenerator.fail("该数据不存在!");
}
Part part = fromDto(dto);
part.setId(dto.getId());
part.setUpdateBy(BaseContextHandler.getUsername());
part.setUpdateTime(new Date());
partService.saveOrUpdate(part);
}catch (Exception ex){
return ResultGenerator.fail(ex.getMessage());
}
return ResultGenerator.success();
}
public PartDto toLazyDto(Part entity) {
PartDto partDto = new PartDto();
BeanUtils.copyProperties(entity,partDto);
return partDto;
}
public PartDto toEagerDto(Part entity) {
PartDto partDto = new PartDto();
BeanUtils.copyProperties(entity, partDto);
return partDto;
}
public Part fromDto(PartDto dto) {
Part part = new Part();
BeanUtils.copyProperties(dto, part);
return part;
}
}
......@@ -74,4 +74,8 @@ public class AccessoryDetails {
String unit;
@ApiModelProperty(value = "物料供应商")
String supplier;
@ApiModelProperty(value = "部位编码")
String partCode;
@ApiModelProperty(value = "部位名称")
String partName;
}
\ No newline at end of file
package com.sw.common.accessory.server.dto;
import com.sw.common.mybatisplus.base.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 热场物料部门维护表
*/
@Data
@ApiModel(value = "热场物料部门Dto")
public class AccessoryPartBo {
private Long id;
/**
* 设备类型id
*/
@ApiModelProperty(value = "设备类型id")
private Integer deviceTypeId;
/**
* 设备类型编码
*/
@ApiModelProperty(value = "设备类型编码")
private String deviceTypeCode;
/**
* 设备类型名称
*/
@ApiModelProperty(value = "设备类型名称")
private String deviceTypeName;
/**
* 总数量
*/
@ApiModelProperty(value = "总数量")
private Integer totalNumber;
/**
* 已使用数量
*/
@ApiModelProperty(value = "已使用数量")
private Integer usedNumber;
/**
* 可使用数量
*/
@ApiModelProperty(value = "可使用数量")
private Integer usableNumber;
/**
* 是否可用
*/
@ApiModelProperty(value = "是否可用")
private Boolean isUse;
/**
* 部门
*/
@ApiModelProperty(value = "部位对象")
private List<PartDto> partDtos;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String updateBy;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
package com.sw.common.accessory.server.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 热场物料部门维护表
*/
@Data
@ApiModel(value = "热场物料部门明细Dto")
public class AccessoryPartDetailsDto {
private Long id;
/**
* 设备类型id
*/
@ApiModelProperty(value = "设备类型id")
private Integer deviceTypeId;
/**
* 设备类型编码
*/
@ApiModelProperty(value = "设备类型编码")
private String deviceTypeCode;
/**
* 设备类型名称
*/
@ApiModelProperty(value = "设备类型名称")
private String deviceTypeName;
/**
* 设备id
*/
@ApiModelProperty(value = "设备id")
private Integer deviceModelId;
/**
* 设备编码
*/
@ApiModelProperty(value = "设备编码")
private String deviceModelCode;
/**
* 设备名称
*/
@ApiModelProperty(value = "设备名称")
private String deviceModelName;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer partId;
/**
* 部门编码
*/
@ApiModelProperty(value = "部门编码")
private String partCode;
/**
* 部门名称
*/
@ApiModelProperty(value = "部门编码")
private String partName;
/**
* 物料id
*/
@ApiModelProperty(value = "物料id")
private Integer materialId;
/**
* 物料编码
*/
@ApiModelProperty(value = "物料编码")
private String materialCode;
/**
* 物料名称
*/
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 总数量
*/
@ApiModelProperty(value = "总数量")
private Integer totalNumber;
/**
* 已使用数量
*/
@ApiModelProperty(value = "已使用数量")
private Integer usedNumber;
/**
* 可使用数量
*/
@ApiModelProperty(value = "可使用数量")
private Integer usableNumber;
/**
* 是否可用
*/
@ApiModelProperty(value = "是否可用")
private Boolean isUse;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String updateBy;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
package com.sw.common.accessory.server.dto;
import com.sw.common.mybatisplus.base.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 热场物料部门维护表
*/
@Data
@ApiModel(value = "热场物料部门Dto")
public class AccessoryPartDto{
private Long id;
/**
* 设备类型id
*/
@ApiModelProperty(value = "设备类型id")
private Integer deviceTypeId;
/**
* 设备类型编码
*/
@ApiModelProperty(value = "设备类型编码")
private String deviceTypeCode;
/**
* 设备类型名称
*/
@ApiModelProperty(value = "设备类型名称")
private String deviceTypeName;
/**
* 设备id
*/
@ApiModelProperty(value = "设备id")
private Integer deviceModelId;
/**
* 设备编码
*/
@ApiModelProperty(value = "设备编码")
private String deviceModelCode;
/**
* 设备名称
*/
@ApiModelProperty(value = "设备名称")
private String deviceModelName;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer partId;
/**
* 部门编码
*/
@ApiModelProperty(value = "部门编码")
private String partCode;
/**
* 部门名称
*/
@ApiModelProperty(value = "部门编码")
private String partName;
/**
* 物料id
*/
@ApiModelProperty(value = "物料id")
private Integer materialId;
/**
* 物料编码
*/
@ApiModelProperty(value = "物料编码")
private String materialCode;
/**
* 物料名称
*/
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 总数量
*/
@ApiModelProperty(value = "总数量")
private Integer totalNumber;
/**
* 已使用数量
*/
@ApiModelProperty(value = "已使用数量")
private Integer usedNumber;
/**
* 可使用数量
*/
@ApiModelProperty(value = "可使用数量")
private Integer usableNumber;
/**
* 是否可用
*/
@ApiModelProperty(value = "是否可用")
private Boolean isUse;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String updateBy;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
......@@ -19,7 +19,7 @@ public class ApplyAccessoryParamDto {
Long materialId;
@NotNull(message = "数量,不能为空")
@ApiModelProperty(value = "数量", required = true)
int number;
Integer number;
@NotBlank(message = "申请原因,不能为空")
@ApiModelProperty(value = "申请原因", required = true)
String reason;
......
package com.sw.common.accessory.server.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 要料申请对象
*/
@Data
public class ApplyMaterialParamDto {
@ApiModelProperty(value = "设备号")
String equipmentCode;
@ApiModelProperty(value = "申请原因", required = true)
String reason;
@NotBlank(message = "申请部位对象,不能为空")
@ApiModelProperty(value = "申请部位对象", required = true)
List<ApplyMaterialPartDto> partDtos;
}
package com.sw.common.accessory.server.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 要料申请部位
*/
@Data
public class ApplyMaterialPartDto {
/**
* 部位id
*/
@ApiModelProperty(value = "部位id")
private Long partId;
/**
* 部位编码
*/
@ApiModelProperty(value = "部位编码")
private String partCode;
/**
* 部位名称
*/
@ApiModelProperty(value = "部位编码")
private String partName;
/**
* 物料id
*/
@ApiModelProperty(value = "物料id")
private Long materialId;
/**
* 物料编码
*/
@ApiModelProperty(value = "物料编码")
private String materialCode;
/**
* 物料名称
*/
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 数量
*/
@ApiModelProperty(value = "数量", required = true)
private Integer number;
}
......@@ -20,6 +20,21 @@ public class ApplyRecordDto {
private Long id;
@ApiModelProperty(value = "申请单号")
private String code;
/**
* 设备类型id
*/
@ApiModelProperty(value = "设备类型id")
private Integer deviceTypeId;
/**
* 设备类型编码
*/
@ApiModelProperty(value = "设备类型编码")
private String deviceTypeCode;
/**
* 设备类型名称
*/
@ApiModelProperty(value = "设备类型名称")
private String deviceTypeName;
@ApiModelProperty(value = "设备号", required = true)
private String equipmentCode;
@ApiModelProperty(value = "物料id", required = true)
......@@ -48,4 +63,13 @@ public class ApplyRecordDto {
@ApiModelProperty(value = "确认时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gmtConfirm;
@ApiModelProperty(value = "部位id")
private Long partId;
@ApiModelProperty(value = "部位编码")
private String partCode;
@ApiModelProperty(value = "部位名称")
private String partName;
}
\ No newline at end of file
package com.sw.common.accessory.server.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/** 设备类型
*
* @author Administrator */
@Data
@ApiModel(value = "设备类型Dto")
public class DeviceDto {
private Long id;
@ApiModelProperty("设备名称")
private String name;
@ApiModelProperty("设备类型编号")
private String code;
}
package com.sw.common.accessory.server.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @Author
* @Description:
* @Date: Create in
* @Modified By:
*/
@Data
@ApiModel(value = "字典词条Dto")
public class DictionaryItemDto {
private Integer id;
@ApiModelProperty(value = "名称", required = true)
String name;
@ApiModelProperty(value = "值", required = true)
String value;
@ApiModelProperty(value = "主题id", required = true)
Integer themeId;
@ApiModelProperty(value = "是否生效", required = true)
Boolean enable;
@ApiModelProperty(value = "优先级")
Integer priority;
@ApiModelProperty(value = "扩展信息1")
String extendValue;
@ApiModelProperty(value = "扩展信息2")
String extendValue1;
@ApiModelProperty(value = "扩展信息3")
String extendValue2;
@ApiModelProperty(value = "创建人id")
Integer createUserId;
@ApiModelProperty(value = "创建人姓名")
String createUserName;
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
Date createTime;
}
package com.sw.common.accessory.server.dto;
import com.sw.common.mybatisplus.base.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import java.util.Date;
/**
* 热场部位维护表
*/
@Data
@ApiModel(value = "热场部位Dto")
public class PartDto{
private Long id;
/**
* 设备id
*/
private Integer deviceModelId;
/**
* 设备编码
*/
private String deviceModelCode;
/**
* 设备名称
*/
private String deviceModelName;
/**
* 部位编码
*/
@ApiModelProperty(value = "部位编码", required = true)
private String partCode;
/**
* 部位名称
*/
@ApiModelProperty(value = "部位名称")
private String partName;
/**
* 物料id
*/
@ApiModelProperty(value = "物料id")
private Integer materialId;
/**
* 物料编码
*/
@ApiModelProperty(value = "物料编码")
private String materialCode;
/**
* 物料名称
*/
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
private Integer count;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String updateBy;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
package com.sw.common.accessory.server.dto;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author liru
* @date 2024-01-06
*/
@Data
@ApiModel(value = "货物移动批次特性Dto")
public class ReportSapChargItemDto
{
/** 批次特性 */
@JSONField(name = "ZFCP_FLAG")
@ApiModelProperty(value = "批次特性" )
private String atnam;
/** 批次特性值 */
@ApiModelProperty(value = "批次特性值" )
@JSONField(name = "CHARG_ITEM")
private String atwrt;
}
package com.sw.common.accessory.server.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* MES报工SAP货物移动接口对象 report_sap_goodsmvt
*
* @author liru
* @date 2024-01-06
*/
@Data
@ApiModel(value = "MES报工SAP货物移动接口Dto")
public class ReportSapGoodsmvtDto
{
/** ID */
@ApiModelProperty(value = "ID" )
@JSONField(serialize = false)
private Long id;
/** 唯一事务ID */
@ApiModelProperty(value = "唯一事务ID" )
@JSONField(serialize = false)
private String zuuid;
/** 过账日期 */
@ApiModelProperty(value = "过账日期" )
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JSONField(serialize = false)
private Date budat;
/** 凭证日期 */
@ApiModelProperty(value = "凭证日期" )
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JSONField(serialize = false)
private Date bldat;
/** 过账人 */
@ApiModelProperty(value = "过账人" )
@JSONField(serialize = false)
private String ernam;
/** 参照 */
@ApiModelProperty(value = "参照" )
@JSONField(serialize = false)
private String xblnr;
/** 提单号 */
@ApiModelProperty(value = "提单号" )
@JSONField(serialize = false)
private String frbnr;
/** 移动类型
* <pre>
* 工单类型 报工类型 分类 报工类型
拉晶工单 消耗 原料消耗 正数261 负数262
石墨件消耗 正数201负数202
氩气消耗 正数261 负数262
收货 主产品 正数101,负102
副产品 正数531,负数532
工时 工单工时
截断工单 消耗 原料消耗 正数261 负数262
收货 主产品 正数101,负102
副产品 正数531,负数532
工时 工单工时
刀刨工单 消耗 原料消耗 正数261 负数262
收货 主产品 正数101,负102
副产品 正数531,负数532
工时 工单工时
籽晶工单 消耗 原料消耗 正数261 负数262
收货 主产品 正数101,负102
副产品 正数531,负数532
籽晶工单 消耗 原料消耗 正数261 负数262
收货 硅料 正数101,负102
副产品 正数531,负数532
成本中心 消耗 石墨件消耗 正数201负数202
硅料 正数201负数202
* </pre>
* */
@ApiModelProperty(value = "移动类型" )
@JSONField(name = "BWART")
@NotBlank
private String bwart;
/** 成本中心 */
@ApiModelProperty(value = "成本中心" )
@JSONField(name = "KOSTL")
private String kostl;
/** SAP生产订单 */
@ApiModelProperty(value = "SAP生产订单" )
@JSONField(name = "AUFNR")
private String aufnr;
/** 销售订单 */
@ApiModelProperty(value = "销售订单 可不填" )
@JSONField(name = "VBELN")
private String vbeln;
/** 销售订单行 */
@ApiModelProperty(value = "销售订单行 可不填" )
@JSONField(name = "POSNR")
private String posnr;
/** 采购订单 */
@ApiModelProperty(value = "采购订单 可不填" )
@JSONField(name = "EBELN")
private String ebeln;
/** 采购订单行 */
@ApiModelProperty(value = "采购订单行 可不填" )
@JSONField(name = "EBELP")
private String ebelp;
/** SAP预留 */
@ApiModelProperty(value = "SAP预留 可不填" )
@JSONField(name = "RSNUM")
private String rsnum;
/** SAP预留行项目 */
@ApiModelProperty(value = "SAP预留行项目 可不填" )
@JSONField(name = "RSPOS")
private String rspos;
/** 发货工厂 */
@ApiModelProperty(value = "发货工厂 可不填" )
@JSONField(name = "WERKS")
private String werks;
/** 库存地点 */
@ApiModelProperty(value = "库存地点" )
@JSONField(name = "LGORT")
private String lgort;
/** 物料编码 */
@ApiModelProperty(value = "物料编码" )
@JSONField(name = "MATNR")
private String matnr;
/** 批次号 */
@ApiModelProperty(value = "批次号" )
@JSONField(name = "CHARG")
private String charg;
/** 数量 */
@ApiModelProperty(value = "数量" )
@JSONField(name = "MENGE")
private String menge;
/** 单位 */
@ApiModelProperty(value = "单位" )
@JSONField(name = "MEINS")
private String meins;
/** 收货工厂 */
@ApiModelProperty(value = "收货工厂" )
@JSONField(name = "UMWRK")
private String umwrk;
/** 收货库区 */
@ApiModelProperty(value = "收货库区" )
@JSONField(name = "UMLGO")
private String umlgo;
/** 收货批次号 */
@ApiModelProperty(value = "收货批次号" )
@JSONField(name = "UMCHA")
private String umcha;
/** 文本 */
@ApiModelProperty(value = "文本" )
@JSONField(name = "SGTXT")
private String sgtxt;
/** 副产品标识
* 如是副产品填: X
* */
@ApiModelProperty(value = "副产品标识" )
@JSONField(name = "ZFCP_FLAG")
private String zfcpFlag;
/**发料次数**/
@ApiModelProperty(value = "发料次数" )
@JSONField(name = "OTHER1")
private String other1;
/** 批次特性信息 */
@ApiModelProperty(value = "批次特性信息集合" )
@JSONField(name = "CHARG_ITEM")
private List<ReportSapChargItemDto> chargItems = new ArrayList<>();
@JSONField(serialize = false)
private Boolean status;
@JSONField(serialize = false)
private String crystalNo;
/**工序名称**/
@JSONField(serialize = false)
private String procName;
}
package com.sw.common.accessory.server.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* MES报工SAP工时接口对象 report_sap_workinghours
*
* @author liru
* @date 2024-01-07
*/
@Data
@ApiModel(value = "MES报工SAP工时接口Dto")
public class ReportSapWorkinghoursDto
{
/** ID */
@ApiModelProperty(value = "ID" )
@JSONField(serialize = false)
private Long id;
/** Recode Id */
@ApiModelProperty(value = "Recode Id" )
@JSONField(name = "RECORD_ID")
private String recordId;
/** 生产订单号码 */
@ApiModelProperty(value = "生产订单号码" )
@JSONField(name = "PRODUCTION_ORDER_ID")
private String productionOrderId;
/** 工厂 */
@ApiModelProperty(value = "工厂" )
@JSONField(name = "PLANT")
private String plant;
/** 生产订单类型 */
@ApiModelProperty(value = "生产订单类型" )
@JSONField(name = "ORDER_TYPE")
private String orderType;
/** 生产订单工序号 */
@ApiModelProperty(value = "生产订单工序号 " )
@JSONField(name = "OPERATION_ID")
private String operationId;
/** 生产订单工作中心 */
@ApiModelProperty(value = "生产订单工作中心" )
@JSONField(name = "WORKCENTER_ID")
private String workcenterId;
/** 合格数量 */
@ApiModelProperty(value = "合格数量" )
@JSONField(name = "CNF_QTY1")
private String cnfQty1;
/** 报废数量 */
@ApiModelProperty(value = "报废数量" )
@JSONField(name = "CNF_QTY2")
private String cnfQty2;
/** 返工数量 */
@ApiModelProperty(value = "返工数量" )
@JSONField(name = "CNF_QTY3")
private String cnfQty3;
/** 单位 */
@ApiModelProperty(value = "单位" )
@JSONField(name = "CNF_UOM")
private String cnfUom;
/** 实际加工时间 */
@ApiModelProperty(value = "实际加工时间" )
@JSONField(name = "CNF_TIME")
private String cnfTime;
/** 实际加工时间单位 */
@ApiModelProperty(value = "实际加工时间单位" )
@JSONField(name = "CNF_TIME_UOM")
private String cnfTimeUom;
/** 确认日期 */
@ApiModelProperty(value = "确认日期" )
@JsonFormat(pattern = "yyyy-MM-dd")
@JSONField(name = "CNF_DATE",format = "yyyy-MM-dd")
private Date cnfDate;
/** 报工状态(0:未报工,1:已报工) */
@ApiModelProperty(value = "报工状态(0:未报工,1:已报工)" )
@JSONField(serialize = false)
private Boolean status;
}
......@@ -180,14 +180,6 @@ public class Accessory extends BaseEntity {
}
public Date getUpperTime() {
if (this.status == EnumValuesAccy.AccyUseStatus.上机中.getKey()
|| this.status == EnumValuesAccy.AccyUseStatus.退库中.getKey()) {
return upperTime;
}
return null;
}
/**
* 下机时间
*/
......
package com.sw.common.accessory.server.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 热场物料部门维护表
*/
@Data
@NoArgsConstructor
@TableName(value="accy_accessory_part")
public class AccessoryPart {
@TableId(type = IdType.AUTO)
private Long id;
/**
* 设备类型id
*/
private Integer deviceTypeId;
/**
* 设备类型编码
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 设备id
*/
private Integer deviceModelId;
/**
* 设备编码
*/
private String deviceModelCode;
/**
* 设备名称
*/
private String deviceModelName;
/**
* 部门id
*/
private Integer partId;
/**
* 部门编码
*/
private String partCode;
/**
* 部门名称
*/
private String partName;
/**
* 物料id
*/
private Integer materialId;
/**
* 物料编码
*/
private String materialCode;
/**
* 物料名称
*/
private String materialName;
/**
* 总数量
*/
private Integer totalNumber;
/**
* 已使用数量
*/
private Integer usedNumber;
/**
* 可使用数量
*/
private Integer usableNumber;
/**
* 是否可用
*/
private Boolean isUse;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改人
*/
private String updateBy;
/**
* 修改时间
*/
private Date updateTime;
public void setUsableNumber(Integer totalNumber, Integer usedNumber){
if(totalNumber>usedNumber){
this.usableNumber = totalNumber -usedNumber;
this.isUse = true;
}else {
this.usableNumber = 0;
this.isUse = false;
}
}
}
package com.sw.common.accessory.server.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 热场物料部门维护明细表
*/
@Data
@NoArgsConstructor
@TableName(value="accy_accessory_part_details")
public class AccessoryPartDetails {
@TableId(type = IdType.AUTO)
private Long id;
/**
* 设备类型id
*/
private Integer deviceTypeId;
/**
* 设备类型编码
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 设备id
*/
private Integer deviceModelId;
/**
* 设备编码
*/
private String deviceModelCode;
/**
* 设备名称
*/
private String deviceModelName;
/**
* 部门id
*/
private Integer partId;
/**
* 部门编码
*/
private String partCode;
/**
* 部门名称
*/
private String partName;
/**
* 物料id
*/
private Integer materialId;
/**
* 物料编码
*/
private String materialCode;
/**
* 物料名称
*/
private String materialName;
/**
* 总数量
*/
private Integer totalNumber;
/**
* 已使用数量
*/
private Integer usedNumber;
/**
* 可使用数量
*/
private Integer usableNumber;
/**
* 是否可用
*/
private Boolean isUse;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改人
*/
private String updateBy;
/**
* 修改时间
*/
private Date updateTime;
public void setUsableNumber(Integer totalNumber, Integer usedNumber){
if(totalNumber>usedNumber){
this.usableNumber = totalNumber -usedNumber;
this.isUse = true;
}else {
this.usableNumber = 0;
this.isUse = false;
}
}
}
......@@ -6,6 +6,7 @@ package com.sw.common.accessory.server.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
......@@ -32,7 +33,18 @@ public class ApplyRecord implements Serializable{
* 设备号
*/
private String equipmentCode;
/**
* 设备类型id
*/
private Integer deviceTypeId;
/**
* 设备类型编码
*/
private String deviceTypeCode;
/**
* 设备类型名称
*/
private String deviceTypeName;
/**
* 物料id
*/
......@@ -47,7 +59,20 @@ public class ApplyRecord implements Serializable{
* 物料名称
*/
private String materialName;
/**
* 部位id
*/
private Long partId;
/**
* 部位编码
*/
private String partCode;
/**
* 部位名称
*/
private String partName;
/**
* 物料料号
*/
......
package com.sw.common.accessory.server.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 热场部门维护表
*/
@Data
@NoArgsConstructor
@TableName(value="accy_part")
public class Part {
@TableId(type = IdType.AUTO)
private Long id;
/**
* 部门编码
*/
private String partCode;
/**
* 部门名称
*/
private String partName;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改人
*/
private String updateBy;
/**
* 修改时间
*/
private Date updateTime;
}
......@@ -2,24 +2,23 @@ package com.sw.common.accessory.server.interfaces.in.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.sw.common.accessory.api.feignCilent.YbFeignClients;
import com.sw.common.accessory.api.model.EquipmentDto;
import com.sw.common.accessory.server.EnumValuesAccy;
import com.sw.common.accessory.server.dto.AccessoryMaterialInfo;
import com.sw.common.accessory.server.dto.ApplyAccessoryData;
import com.sw.common.accessory.server.entity.Accessory;
import com.sw.common.accessory.server.entity.ApplyRecord;
import com.sw.common.accessory.server.entity.EquipmentAccessory;
import com.sw.common.accessory.server.entity.ReturnRecord;
import com.sw.common.accessory.server.dto.DeviceDto;
import com.sw.common.accessory.server.entity.*;
import com.sw.common.accessory.server.interfaces.in.AccyInService;
import com.sw.common.accessory.server.interfaces.out.AccyOutService;
import com.sw.common.accessory.server.service.AccessoryService;
import com.sw.common.accessory.server.service.ApplyRecordService;
import com.sw.common.accessory.server.service.EquipmentAccessoryService;
import com.sw.common.accessory.server.service.ReturnRecordService;
import com.sw.common.accessory.server.service.*;
import com.sw.common.core.exception.BusinessException;
import com.sw.common.core.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
......@@ -46,7 +45,12 @@ public class AccyInServiceImpl implements AccyInService {
@Autowired
private AccyOutService accyOutService;
@Autowired
private AccessoryPartService accessoryPartService;
@Autowired
private AccessoryPartDetailsService accessoryPartDetailsService;
@Autowired
private YbFeignClients ybFeignClients;
@Override
public void stockReturnApplyFeedback(String code, int status, String userConfirm) throws BusinessException {
Assert.notNull(code, "退库单号,不能为空");
......@@ -61,6 +65,11 @@ public class AccyInServiceImpl implements AccyInService {
returnRecord.setUserConfirm(userConfirm);
returnRecord.setGmtConfirm(new Date());
accessoryService.cancelReturnRecordSave(accessory, returnRecord);
} else if(status == 2){
returnRecord.setStatus(EnumValuesAccy.ReturnStatus.HAS_CANCEL.getKey());
returnRecord.setUserConfirm(userConfirm);
returnRecord.setGmtConfirm(new Date());
accessoryService.cancelReturnRecordSave(accessory, returnRecord);
} else if (status == 0) {
EquipmentAccessory equipmentAccessory = equipmentAccessoryService.get(accessory.getEquipmentAccessoryId());
equipmentAccessoryService.updateStockReturnCount(equipmentAccessory.getId(), equipmentAccessory.getStockReturnCount(), -1);
......@@ -97,6 +106,24 @@ public class AccyInServiceImpl implements AccyInService {
applyRecord.setStatus(EnumValuesAccy.ApplyStatus.REFUSE.getKey());
boolean updateApplyRecordStatus = applyRecordService.update(applyRecord, new LambdaUpdateWrapper<ApplyRecord>().eq(ApplyRecord::getId, applyRecord.getId()).eq(ApplyRecord::getStatus, EnumValuesAccy.ApplyStatus.WAITING.getKey()));
Assert.isTrue(updateApplyRecordStatus, "失败,请重试,辅材申请单状态修改失败");
// Result<EquipmentDto> equipmentInfoDto = ybFeignClients.getByCodeDto(applyRecord.getEquipmentCode());
// String deviceTypeCode = new String();
// if(equipmentInfoDto.getCode().equals(200)){
// Result<DeviceDto> result = ybFeignClients.getDeviceId(equipmentInfoDto.getData().getDeviceId());
// if(result.getCode().equals(200)){
// deviceTypeCode = result.getData().getCode();
// }else {
// throw new BusinessException("未查询到当前设备的设备类型数据!");
// }
// }else {
// throw new BusinessException("未查询到当前设备数据!");
// }
// AccessoryPartDetails accessoryPart = accessoryPartDetailsService.getByCode(deviceTypeCode,applyRecord.getEquipmentCode(),applyRecord.getMaterialCode(), applyRecord.getPartCode());
// if(!ObjectUtils.isEmpty(accessoryPart)){
// accessoryPart.setUsableNumber(accessoryPart.getTotalNumber(),accessoryPart.getUsedNumber()-applyRecord.getNumber());
// accessoryPart.setUsedNumber(accessoryPart.getUsedNumber()-applyRecord.getNumber());
// accessoryPartDetailsService.updateById(accessoryPart);
// }
} else if (applyAccessoryData.getStatus() == 0) {
// 修改出库单状态以及确认人
applyRecord.setStatus(EnumValuesAccy.ApplyStatus.OUT.getKey());
......@@ -124,6 +151,24 @@ public class AccyInServiceImpl implements AccyInService {
Assert.isTrue(updateAccessoryStatus, "失败,请重试,辅料状态修改失败");
}
}
// Result<EquipmentDto> equipmentInfoDto = ybFeignClients.getByCodeDto(applyRecord.getEquipmentCode());
// String deviceCodes = new String();
// if(equipmentInfoDto.getCode().equals(200)){
// Result<DeviceDto> result = ybFeignClients.getDeviceId(equipmentInfoDto.getData().getDeviceId());
// if(result.getCode().equals(200)){
// deviceCodes = result.getData().getCode();
// }else {
// throw new BusinessException("未查询到当前设备的设备类型数据!");
// }
// }else {
// throw new BusinessException("未查询到当前设备数据!");
// }
// AccessoryPartDetails accessoryPart = accessoryPartDetailsService.getByCode(deviceCodes,applyRecord.getEquipmentCode(),applyRecord.getMaterialCode(), applyRecord.getPartCode());
// if(!ObjectUtils.isEmpty(accessoryPart)){
// accessoryPart.setUsableNumber(accessoryPart.getTotalNumber(),accessoryPart.getUsedNumber()-applyRecord.getNumber());
// accessoryPart.setUsedNumber(accessoryPart.getUsedNumber()-applyRecord.getNumber());
// accessoryPartDetailsService.updateById(accessoryPart);
// }
} else {
throw new BusinessException("status参数错误");
}
......
......@@ -78,4 +78,12 @@ public interface AccyOutService {
default AccessoryMaterialInfo getByMaterialCode(String materialCode) {
throw new BusinessException("请实现【获取辅材信息】的接口");
}
/**
* 获取热场模型信息
* @param materialCode 热场模型id
* @return 热场数据
*/
default AccessoryMaterialInfo getByMaterialCodes(String materialCode) {
throw new BusinessException("请实现【获取辅材信息】的接口");
}
}
package com.sw.common.accessory.server.mapper;
import com.sw.common.accessory.server.entity.AccessoryPartDetails;
import com.sw.common.mybatisplus.base.BaseDao;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface AccessoryPartDetailsMapper extends BaseDao<AccessoryPartDetails> {
@Delete("delete from accy_accessory_part_details where material_id = #{materialId}")
Boolean deleteByMaterialId(Integer materialId);
@Select("select * from accy_accessory_part_details where material_code = #{materialCode}")
List<AccessoryPartDetails> getByMaterialCode(String materialCode);
@Select("select * from accy_accessory_part_details where part_code = #{partCode}")
List<AccessoryPartDetails> getByPartCode(String partCode);
@Select("select * from accy_accessory_part_details where device_type_code = #{deviceTypeCode} and device_model_code = #{deviceCode} and material_code = #{materialCode} and part_code = #{partCode}")
AccessoryPartDetails getByCode(String deviceTypeCode, String deviceCode, String materialCode, String partCode);
@Select("select * from accy_accessory_part_details where device_type_code = #{deviceTypeCode} and material_code = #{materialCode} and part_code = #{partCode}")
List<AccessoryPartDetails> getByNotDeviceCode(String deviceTypeCode, String materialCode, String partCode);
@Select("select * from accy_accessory_part_details where device_type_code = #{deviceTypeCode}")
List<AccessoryPartDetails> getByDeviceTypeCode(String deviceTypeCode);
@Select("select * from accy_accessory_part_details where device_model_code = #{deviceCode}")
List<AccessoryPartDetails> getByDeviceCode(String deviceCode);
@Select("delete from accy_accessory_part_details where device_type_code = #{deviceTypeCode} and material_code = #{materialCode} and part_code = #{partCode}")
Boolean deletaByCode(String deviceTypeCode,String materialCode,String partCode);
}
package com.sw.common.accessory.server.mapper;
import com.sw.common.accessory.server.entity.AccessoryPart;
import com.sw.common.mybatisplus.base.BaseDao;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface AccessoryPartMapper extends BaseDao<AccessoryPart> {
@Delete("delete from accy_accessory_part where material_id = #{materialId}")
Boolean deleteByMaterialId(Integer materialId);
@Select("select * from accy_accessory_part where material_code = #{materialCode}")
List<AccessoryPart> getByMaterialCode(String materialCode);
@Select("select * from accy_accessory_part where part_code = #{partCode}")
List<AccessoryPart> getByPartCode(String partCode);
@Select("select * from accy_accessory_part where device_type_code = #{deviceTypeCode} and device_model_code = #{deviceCode} and material_code = #{materialCode} and part_code = #{partCode}")
AccessoryPart getByCode(String deviceTypeCode,String deviceCode,String materialCode,String partCode);
@Select("select * from accy_accessory_part where device_type_code = #{deviceTypeCode} and material_code = #{materialCode} and part_code = #{partCode}")
AccessoryPart getByTypeCode(String deviceTypeCode,String materialCode,String partCode);
@Select("select * from accy_accessory_part where device_type_code = #{deviceCode}")
List<AccessoryPart> getByDeviceCode(String deviceCode);
}
package com.sw.common.accessory.server.mapper;
import com.sw.common.accessory.server.entity.Part;
import com.sw.common.mybatisplus.base.BaseDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface PartMapper extends BaseDao<Part> {
@Select("select * from accy_part where part_code = #{partCode}")
Part getByPartCode(String partCode);
}
package com.sw.common.accessory.server.service;
import com.sw.common.accessory.server.entity.AccessoryPartDetails;
import com.sw.common.mybatisplus.base.BaseService;
import java.util.List;
public interface AccessoryPartDetailsService extends BaseService<AccessoryPartDetails> {
List<AccessoryPartDetails> getByMaterialCode(String materialCode);
List<AccessoryPartDetails> getByPartCode(String partCode);
List<AccessoryPartDetails> getByDeviceTypeCode(String deviceTypeCode);
List<AccessoryPartDetails> getByDeviceCode(String deviceCode);
AccessoryPartDetails getByCode(String deviceTypeCode, String deviceCode, String materialCode, String partCode);
List<AccessoryPartDetails> getByNotDeviceCode(String deviceTypeCode, String materialCode, String partCode);
Boolean deletaByCode(String deviceTypeCode,String materialCode,String partCode);
}
package com.sw.common.accessory.server.service;
import com.sw.common.accessory.server.dto.AccessoryPartBo;
import com.sw.common.accessory.server.dto.AccessoryPartDto;
import com.sw.common.accessory.server.entity.AccessoryPart;
import com.sw.common.mybatisplus.base.BaseService;
import java.util.List;
public interface AccessoryPartService extends BaseService<AccessoryPart> {
Boolean create(AccessoryPartBo bo);
Boolean update(AccessoryPartDto bo);
List<AccessoryPart> getByMaterialCode(String materialCode);
List<AccessoryPart> getByPartCode(String partCode);
List<AccessoryPart> getByDeviceCode(String deviceCode);
AccessoryPart getByCode(String deviceTypeCode,String deviceCode,String materialCode,String partCode);
AccessoryPart getByTypeCode(String deviceTypeCode,String materialCode,String partCode);
}
package com.sw.common.accessory.server.service;
import com.sw.common.accessory.server.dto.ApplyAccessoryParamDto;
import com.sw.common.accessory.server.dto.ApplyMaterialParamDto;
import com.sw.common.accessory.server.dto.EquipmentInfo;
import com.sw.common.accessory.server.entity.EquipmentAccessory;
import com.sw.common.mybatisplus.base.BaseService;
......@@ -13,6 +14,7 @@ import com.sw.common.mybatisplus.base.BaseService;
*/
public interface EquipmentAccessoryService extends BaseService<EquipmentAccessory> {
void applyAccessory(ApplyAccessoryParamDto applyAccessoryParamDto);
void applyMaterial(ApplyMaterialParamDto applyAccessoryParamDto);
/**
* 创建新的设备辅材
......
package com.sw.common.accessory.server.service;
import com.sw.common.accessory.server.entity.Part;
import com.sw.common.mybatisplus.base.BaseService;
public interface PartService extends BaseService<Part> {
Part getByPartCode(String partCode);
}
package com.sw.common.accessory.server.service.impl;
import com.sw.common.accessory.server.entity.AccessoryPartDetails;
import com.sw.common.accessory.server.mapper.AccessoryPartDetailsMapper;
import com.sw.common.accessory.server.service.AccessoryPartDetailsService;
import com.sw.common.mybatisplus.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AccessoryPartDetailsServiceImpl extends BaseServiceImpl<AccessoryPartDetailsMapper, AccessoryPartDetails> implements AccessoryPartDetailsService {
@Autowired
private AccessoryPartDetailsMapper accessoryPartDtailsMapper;
@Override
public List<AccessoryPartDetails> getByMaterialCode(String materialCode) {
return accessoryPartDtailsMapper.getByMaterialCode(materialCode);
}
@Override
public List<AccessoryPartDetails> getByPartCode(String partCode) {
return accessoryPartDtailsMapper.getByPartCode(partCode);
}
@Override
public List<AccessoryPartDetails> getByDeviceTypeCode(String deviceTypeCode) {
return accessoryPartDtailsMapper.getByDeviceTypeCode(deviceTypeCode);
}
@Override
public List<AccessoryPartDetails> getByDeviceCode(String deviceCode) {
return accessoryPartDtailsMapper.getByDeviceCode(deviceCode);
}
@Override
public AccessoryPartDetails getByCode(String deviceTypeCode, String deviceCode, String materialCode, String partCode) {
return accessoryPartDtailsMapper.getByCode(deviceTypeCode,deviceCode,materialCode,partCode);
}
@Override
public List<AccessoryPartDetails> getByNotDeviceCode(String deviceTypeCode, String materialCode, String partCode) {
return accessoryPartDtailsMapper.getByNotDeviceCode(deviceTypeCode,materialCode,partCode);
}
@Override
public Boolean deletaByCode(String deviceTypeCode,String materialCode, String partCode) {
return accessoryPartDtailsMapper.deletaByCode(deviceTypeCode,materialCode,partCode);
}
}
package com.sw.common.accessory.server.service.impl;
import com.sw.common.accessory.api.feignCilent.YbFeignClients;
import com.sw.common.accessory.api.model.EquipmentDto;
import com.sw.common.accessory.server.dto.AccessoryPartBo;
import com.sw.common.accessory.server.dto.AccessoryPartDto;
import com.sw.common.accessory.server.entity.AccessoryPart;
import com.sw.common.accessory.server.entity.AccessoryPartDetails;
import com.sw.common.accessory.server.mapper.AccessoryPartMapper;
import com.sw.common.accessory.server.service.AccessoryPartDetailsService;
import com.sw.common.accessory.server.service.AccessoryPartService;
import com.sw.common.core.context.BaseContextHandler;
import com.sw.common.core.response.Result;
import com.sw.common.mybatisplus.base.BaseServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
@Service
public class AccessoryPartServiceImpl extends BaseServiceImpl<AccessoryPartMapper, AccessoryPart> implements AccessoryPartService {
@Autowired
private AccessoryPartMapper accessoryPartMapper;
@Autowired
private AccessoryPartDetailsService accessoryPartDetailsService;
@Autowired
private YbFeignClients ybFeignClients;
@Override
@Transactional
public Boolean create(AccessoryPartBo bo) {
if(ObjectUtils.isEmpty(bo)){
return false;
}
if(!ObjectUtils.isEmpty(bo.getPartDtos())){
bo.getPartDtos().stream().forEach(entity->{
AccessoryPart accessoryPart = new AccessoryPart();
BeanUtils.copyProperties(bo,accessoryPart,"id");
accessoryPart.setTotalNumber(entity.getCount());
accessoryPart.setUsableNumber(entity.getCount());
accessoryPart.setUsedNumber(0);
accessoryPart.setMaterialId(entity.getMaterialId());
accessoryPart.setMaterialCode(entity.getMaterialCode());
accessoryPart.setMaterialName(entity.getMaterialName());
accessoryPart.setPartCode(entity.getPartCode());
accessoryPart.setPartName(entity.getPartName());
accessoryPart.setIsUse(true);
accessoryPart.setCreateBy(BaseContextHandler.getUsername());
accessoryPart.setCreateTime(new Date());
accessoryPartMapper.insert(accessoryPart);
Result<List<EquipmentDto>> equipments = ybFeignClients.findByDeviceId(bo.getDeviceTypeId());
if(equipments.getCode().equals(200)){
equipments.getData().stream().forEach(equipment->{
AccessoryPartDetails accessoryPartDtails = new AccessoryPartDetails();
accessoryPartDtails.setPartCode(entity.getPartCode());
accessoryPartDtails.setPartName(entity.getPartName());
accessoryPartDtails.setMaterialCode(entity.getMaterialCode());
accessoryPartDtails.setMaterialId(entity.getMaterialId());
accessoryPartDtails.setMaterialName(entity.getMaterialName());
accessoryPartDtails.setDeviceModelId(Integer.valueOf(String.valueOf(equipment.getId())));
accessoryPartDtails.setDeviceModelCode(equipment.getCode());
accessoryPartDtails.setDeviceModelName(equipment.getName());
accessoryPartDtails.setDeviceTypeId(bo.getDeviceTypeId());
accessoryPartDtails.setDeviceTypeCode(bo.getDeviceTypeCode());
accessoryPartDtails.setDeviceTypeName(bo.getDeviceTypeName());
accessoryPartDtails.setCreateBy(BaseContextHandler.getUsername());
accessoryPartDtails.setCreateTime(new Date());
accessoryPartDtails.setTotalNumber(entity.getCount());
accessoryPartDtails.setUsableNumber(entity.getCount());
accessoryPartDtails.setUsedNumber(0);
accessoryPartDtails.setIsUse(true);
accessoryPartDetailsService.saveOrUpdate(accessoryPartDtails);
});
}
});
}else {
return false;
}
return true;
}
@Override
@Transactional
public Boolean update(AccessoryPartDto dto) {
if(ObjectUtils.isEmpty(dto)){
return false;
}
try{
AccessoryPart accessoryPart = new AccessoryPart();
BeanUtils.copyProperties(dto,accessoryPart);
accessoryPart.setUsableNumber(accessoryPart.getTotalNumber(),accessoryPart.getUsedNumber());
accessoryPart.setUpdateBy(BaseContextHandler.getUsername());
accessoryPart.setUpdateTime(new Date());
accessoryPartMapper.updateById(accessoryPart);
}catch (Exception e){
return false;
}
return true;
}
@Override
public List<AccessoryPart> getByMaterialCode(String materialCode) {
return accessoryPartMapper.getByMaterialCode(materialCode);
}
@Override
public List<AccessoryPart> getByPartCode(String partCode) {
return accessoryPartMapper.getByPartCode(partCode);
}
@Override
public List<AccessoryPart> getByDeviceCode(String deviceCode) {
return accessoryPartMapper.getByDeviceCode(deviceCode);
}
@Override
public AccessoryPart getByCode(String deviceTypeCode,String deviceCode,String materialCode, String partCode) {
return accessoryPartMapper.getByCode(deviceTypeCode,deviceCode,materialCode,partCode);
}
@Override
public AccessoryPart getByTypeCode(String deviceTypeCode,String materialCode, String partCode) {
return accessoryPartMapper.getByTypeCode(deviceTypeCode,materialCode,partCode);
}
}
......@@ -3,26 +3,35 @@ package com.sw.common.accessory.server.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.sw.common.accessory.api.feignCilent.YbFeignClients;
import com.sw.common.accessory.api.model.EquipmentDto;
import com.sw.common.accessory.server.EnumValuesAccy;
import com.sw.common.accessory.server.dto.AccessoryMaterialInfo;
import com.sw.common.accessory.server.dto.ApplyAccessoryParam;
import com.sw.common.accessory.server.dto.ApplyAccessoryParamDto;
import com.sw.common.accessory.server.dto.EquipmentInfo;
import com.sw.common.accessory.server.dto.*;
import com.sw.common.accessory.server.entity.AccessoryPart;
import com.sw.common.accessory.server.entity.AccessoryPartDetails;
import com.sw.common.accessory.server.entity.ApplyRecord;
import com.sw.common.accessory.server.entity.EquipmentAccessory;
import com.sw.common.accessory.server.interfaces.out.AccyOutService;
import com.sw.common.accessory.server.mapper.EquipmentAccessoryMapper;
import com.sw.common.accessory.server.service.AccessoryPartDetailsService;
import com.sw.common.accessory.server.service.AccessoryPartService;
import com.sw.common.accessory.server.service.ApplyRecordService;
import com.sw.common.accessory.server.service.EquipmentAccessoryService;
import com.sw.common.core.context.BaseContextHandler;
import com.sw.common.core.exception.BusinessException;
import com.sw.common.core.response.Result;
import com.sw.common.mybatisplus.base.BaseServiceImpl;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.List;
import java.util.Optional;
;
......@@ -45,6 +54,13 @@ public class EquipmentAccessoryServiceImpl extends BaseServiceImpl<EquipmentAcce
@Autowired
private ApplyRecordService applyRecordService;
@Autowired
private AccessoryPartService accessoryPartService;
@Autowired
private AccessoryPartDetailsService accessoryPartDetailsService;
@Autowired
private YbFeignClients ybFeignClients;
@Override
public void applyAccessory(ApplyAccessoryParamDto applyAccessoryParamDto) throws BusinessException {
//判断设备是否存在
......@@ -72,7 +88,11 @@ public class EquipmentAccessoryServiceImpl extends BaseServiceImpl<EquipmentAcce
applyRecord.setCode(code);
applyRecord.setEquipmentCode(applyAccessoryParamDto.getEquipmentCode());
applyRecord.setMaterialId(applyAccessoryParamDto.getMaterialId());
applyRecord.setMaterialType(accessoryMaterialInfo.getMaterialType());
if (StringUtil.isNotBlank(accessoryMaterialInfo.getMaterialType())) {
applyRecord.setMaterialType(accessoryMaterialInfo.getMaterialType());
} else {
applyRecord.setMaterialType(new String());
}
applyRecord.setMaterialName(accessoryMaterialInfo.getMaterialName());
applyRecord.setMaterialCode(accessoryMaterialInfo.getMaterialCode());
applyRecord.setNumber(applyAccessoryParamDto.getNumber());
......@@ -87,6 +107,78 @@ public class EquipmentAccessoryServiceImpl extends BaseServiceImpl<EquipmentAcce
}
@Override
public void applyMaterial(ApplyMaterialParamDto applyMaterialParamDto) {
//判断设备是否存在
EquipmentInfo equipmentInfo = accyService.getEquipmentInfo(applyMaterialParamDto.getEquipmentCode());
Assert.notNull(equipmentInfo, applyMaterialParamDto.getEquipmentCode() + "该设备号不存在,没有获取到设备信息");
EquipmentAccessory equipmentAccessory = equipmentAccessoryMapper.findByEquipmentCode(applyMaterialParamDto.getEquipmentCode());
if (equipmentAccessory == null) {
createNewEquipmentAccessory(equipmentInfo, 0);
} else {
//修改 待出库数量
updateWaitingOutboundCount(equipmentAccessory.getId(), equipmentAccessory.getWaitingOutboundCount(), 1);
}
applyMaterialParamDto.getPartDtos().stream().forEach(entity -> {
AccessoryMaterialInfo accessoryMaterialInfo = accyService.getByMaterialCode(entity.getMaterialCode());
Assert.notNull(accessoryMaterialInfo, "辅料模型数据不存在");
ApplyAccessoryParam applyAccessoryParam = new ApplyAccessoryParam();
applyAccessoryParam.setEquipmentCode(applyMaterialParamDto.getEquipmentCode());
applyAccessoryParam.setMaterialCode(entity.getMaterialCode());
applyAccessoryParam.setNumber(entity.getNumber());
applyAccessoryParam.setReason(applyMaterialParamDto.getReason());
String code = accyService.applyAccessory(applyAccessoryParam);
//创建申请记录
ApplyRecord applyRecord = new ApplyRecord();
applyRecord.setCode(code);
applyRecord.setEquipmentCode(applyMaterialParamDto.getEquipmentCode());
applyRecord.setMaterialId(entity.getMaterialId());
if (StringUtil.isNotBlank(accessoryMaterialInfo.getMaterialType())) {
applyRecord.setMaterialType(accessoryMaterialInfo.getMaterialType());
} else {
applyRecord.setMaterialType(new String());
}
applyRecord.setMaterialName(accessoryMaterialInfo.getMaterialName());
applyRecord.setMaterialCode(accessoryMaterialInfo.getMaterialCode());
applyRecord.setNumber(entity.getNumber());
applyRecord.setUnit(accessoryMaterialInfo.getUnit());
applyRecord.setReason(applyMaterialParamDto.getReason());
applyRecord.setStatus(0);
applyRecord.setUserCreate(BaseContextHandler.getUsername());
applyRecord.setGmtCreate(new Date());
applyRecord.setUserConfirm(null);
applyRecord.setGmtConfirm(null);
applyRecord.setPartCode(entity.getPartCode());
applyRecord.setPartId(entity.getPartId());
applyRecord.setPartName(entity.getPartName());
applyRecordService.saveOrUpdate(applyRecord);
Result<EquipmentDto> equipmentInfoDto = ybFeignClients.getByCodeDto(applyMaterialParamDto.getEquipmentCode());
String deviceCodes = new String();
if (equipmentInfoDto.getCode().equals(200)) {
Result<DeviceDto> result = ybFeignClients.getDeviceId(equipmentInfoDto.getData().getDeviceId());
if (result.getCode().equals(200)) {
deviceCodes = result.getData().getCode();
} else {
throw new BusinessException("未查询到当前设备的设备类型数据!");
}
} else {
throw new BusinessException("未查询到当前设备数据!");
}
//更新部位使用数量
AccessoryPartDetails accessoryPart = accessoryPartDetailsService.getByCode(deviceCodes, applyMaterialParamDto.getEquipmentCode(), entity.getMaterialCode(), entity.getPartCode());
if (!ObjectUtils.isEmpty(accessoryPart)) {
accessoryPart.setUsableNumber(accessoryPart.getTotalNumber(), accessoryPart.getUsedNumber() + entity.getNumber());
if (accessoryPart.getTotalNumber() - accessoryPart.getUsedNumber() - entity.getNumber() <= 0) {
accessoryPart.setUsedNumber(accessoryPart.getTotalNumber());
} else {
accessoryPart.setUsedNumber(accessoryPart.getUsedNumber() + entity.getNumber());
}
accessoryPartDetailsService.updateById(accessoryPart);
}
});
}
@Override
public EquipmentAccessory createNewEquipmentAccessory(EquipmentInfo equipmentInfo, int type) {
EquipmentAccessory equipmentAccessory = new EquipmentAccessory();
equipmentAccessory.setEarlyWarningCount(0);
......@@ -117,6 +209,25 @@ public class EquipmentAccessoryServiceImpl extends BaseServiceImpl<EquipmentAcce
EquipmentAccessory equipmentAccessory = getOne(new LambdaQueryWrapper<EquipmentAccessory>().eq(EquipmentAccessory::getEquipmentCode, applyRecord.getEquipmentCode()));
updateWaitingOutboundCount(equipmentAccessory.getId(), equipmentAccessory.getWaitingOutboundCount(), -1);
accyService.cancelApplyAccessory(applyRecord.getCode());
Result<EquipmentDto> equipmentInfo = ybFeignClients.getByCodeDto(applyRecord.getEquipmentCode());
String deviceCodes = new String();
if (equipmentInfo.getCode().equals(200)) {
Result<DeviceDto> result = ybFeignClients.getDeviceId(equipmentInfo.getData().getDeviceId());
if (result.getCode().equals(200)) {
deviceCodes = result.getData().getCode();
}
}
AccessoryPartDetails accessoryPart = accessoryPartDetailsService.getByCode(deviceCodes
, applyRecord.getEquipmentCode(), applyRecord.getMaterialCode(), applyRecord.getPartCode());
if (!ObjectUtils.isEmpty(accessoryPart)) {
accessoryPart.setUsableNumber(accessoryPart.getTotalNumber(), accessoryPart.getUsedNumber() - 1);
if (accessoryPart.getTotalNumber() - accessoryPart.getUsedNumber() - 1 <= 0) {
accessoryPart.setUsedNumber(accessoryPart.getTotalNumber());
} else {
accessoryPart.setUsedNumber(accessoryPart.getUsedNumber() + 1);
}
accessoryPartDetailsService.updateById(accessoryPart);
}
}
@Override
......
package com.sw.common.accessory.server.service.impl;
import com.sw.common.accessory.server.entity.Part;
import com.sw.common.accessory.server.mapper.PartMapper;
import com.sw.common.accessory.server.service.PartService;
import com.sw.common.mybatisplus.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class PartServiceImpl extends BaseServiceImpl<PartMapper, Part> implements PartService {
@Autowired
private PartMapper partMapper;
@Override
public Part getByPartCode(String partCode) {
return partMapper.getByPartCode(partCode);
}
}
package com.sw.common.accessory.utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* 籽晶编号生成器
*
* @Author:wanjia
* @Date:2024/1/9 14:38
*/
public class CodeGenerator {
private static final String[] CHARACTER = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L",
"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
private static final String REDIS_KEY = "ssh_no";
/**
* 构建日期
*
* @return
*/
public static String buildDay() {
Calendar calendar = Calendar.getInstance();
int day = calendar.get(Calendar.DAY_OF_MONTH);
if (day <= 9) {
return "0" + day;
}
return java.lang.String.valueOf(day);
}
/**
* 构建月
* 规则:
* 1、1-9月返回数字
* 2、10月A 11月B 12月C
*
* @return
*/
public static String buildMonth() {
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH) + 1;//jdk里面取到的值会-1,所以外面需要加1
if (month <= 9) {
return java.lang.String.valueOf(month);
}
if (month == 10) {
return "A";
} else if (month == 11) {
return "B";
} else if (month == 12) {
return "C";
}
return "";
}
/**
* 构建年的值
* <p>
* 规则:2023年取3,到2029年位置取9
* 2030年开始用A,之后用字母循环使用
*
* @return
*/
public static String buildYear() {
SimpleDateFormat format = new SimpleDateFormat("yyyy");
String yyyy = format.format(new Date());
int year = Integer.parseInt(yyyy);
//如果时间小于2029年,则取尾数
if (year <= 2029) {
return yyyy.substring(3);
}
int mod = year - 2030;
if (mod < 26) { //如果第一轮内
return CHARACTER[mod];
} else {
return CHARACTER[mod % 26];
}
}
/**
* 流水号,001-999 按天维度滚动
* <p>
* 实现逻辑,通过redis做一个锁,key为年月日,value为流水号
* 跟产品确认过
*
* @return
*/
public String buildBatchNo() {
long value = RedisUtils.incrAtomicValue(REDIS_KEY);
if (value < 10) {
return '0'+String.valueOf(value);
}else if(value >= 10 && value < 100){
return String.valueOf(value);
}else {
RedisUtils.setAtomicValue(REDIS_KEY,1);
}
return String.valueOf(value);
}
}
......@@ -7,12 +7,12 @@ spring:
cloud:
nacos:
config:
server-addr: 10.141.0.100:8848
server-addr: 10.27.33.11:8848
file-extension: yaml
namespace: de12f71d-9109-492f-a04e-ed71ca4c5cc3
namespace: 508584bf-3616-477e-a755-a88d52b4adf9
group: DEFAULT_GROUP
shared-configs: mes-accessory-config.yaml
discovery:
server-addr: 10.141.0.100:8848
namespace: de12f71d-9109-492f-a04e-ed71ca4c5cc3
server-addr: 10.27.33.11:8848
namespace: 508584bf-3616-477e-a755-a88d52b4adf9
group: DEFAULT_GROUP
......@@ -38,10 +38,11 @@
<!--auto generated by MybatisCodeHelper on 2023-07-30-->
<select id="findAccessoryDetailsByEquipmentAccessoryId" resultType="com.sw.common.accessory.server.dto.AccessoryDetails">
select
aa.*,fam.specification,fmm.model_number,fmm.number_of_drawings,b.name unit,fam.supplier
aa.*,fam.specification,fmm.model_number,fmm.number_of_drawings,b.name unit,fam.supplier,aap.part_code,aap.part_name
from jinko_accy.accy_accessory aa left join jinko_mes.zhxx_accessory_material fam on aa.material_id = fam.id
left join jinko_mes.factory_material_model fmm on fam.material_model_id = fmm.id
LEFT JOIN jinko_mes.factory_unit b ON fmm.unit_id = b.id
LEFT JOIN jinko_accy.accy_accessory_part aap on aa.material_code = aap.material_code
<where>
<if test="equipmentAccessoryId != null">
and equipment_accessory_id=#{equipmentAccessoryId,jdbcType=BIGINT}
......
......@@ -90,6 +90,7 @@ public class UserController {
if (request.getParameter("search_LIKE_cardNumber") != null) {
queryWrapper.like(AuthUser::getCardNumber, request.getParameter("search_LIKE_cardNumber"));
}
queryWrapper.orderByDesc(AuthUser::getId);
Page<AuthUser> listPage = authUserService.page(new Page<>(requestPage.getPage(), requestPage.getRows()), queryWrapper);
List<UserDto> dtos = listPage.getRecords().stream()
.map(entity -> toLazyDto1(entity))
......
......@@ -533,16 +533,17 @@ public class AuthUserServiceImpl extends ServiceImpl<AuthUserMapper, AuthUser>
if (StringUtils.isBlank(clientType)) {
clientType = "web";
}
String md5Password = DigestUtils.md5DigestAsHex(("user_id" + user.getId()).getBytes());
String tokenPrefix = TOKEN_PREFIX + clientType + "_" + md5Password + "_";
String delTokenPrefix= TOKEN_PREFIX + "web" + "_" + md5Password + "_";
Set<String> keys = redisTemplate.keys(TOKEN_PREFIX + delTokenPrefix + "*");
//找到历史token
if (keys != null && keys.size() > 0) {
for (String historyTokenKeys : keys) {
String historyToken = NumberUtil.object2String(historyTokenKeys, null);
redisTemplate.delete(historyToken);
if(clientType.equals("web")){
String delTokenPrefix= TOKEN_PREFIX + "web" + "_" + md5Password + "_";
Set<String> keys = redisTemplate.keys(TOKEN_PREFIX + delTokenPrefix + "*");
//找到历史token
if (keys != null && keys.size() > 0) {
for (String historyTokenKeys : keys) {
String historyToken = NumberUtil.object2String(historyTokenKeys, null);
redisTemplate.delete(historyToken);
}
}
}
token = tokenPrefix + token;
......
......@@ -7,12 +7,12 @@ spring:
cloud:
nacos:
config:
server-addr: 10.141.0.100:8848
server-addr: 10.27.33.11:8848
file-extension: yaml
namespace: de12f71d-9109-492f-a04e-ed71ca4c5cc3
namespace: 508584bf-3616-477e-a755-a88d52b4adf9
group: DEFAULT_GROUP
shared-configs: mes-auth-config.yaml
discovery:
server-addr: 10.141.0.100:8848
namespace: de12f71d-9109-492f-a04e-ed71ca4c5cc3
server-addr: 10.27.33.11:8848
namespace: 508584bf-3616-477e-a755-a88d52b4adf9
group: DEFAULT_GROUP
server:
port: 9014
port: 9007
spring:
application:
......@@ -7,12 +7,12 @@ spring:
cloud:
nacos:
config:
server-addr: 10.141.0.100:8848
server-addr: 10.27.33.11:8848
file-extension: yaml
namespace: de12f71d-9109-492f-a04e-ed71ca4c5cc3
namespace: 508584bf-3616-477e-a755-a88d52b4adf9
group: DEFAULT_GROUP
shared-configs: mes-gateway-config.yaml
discovery:
server-addr: 10.141.0.100:8848
namespace: de12f71d-9109-492f-a04e-ed71ca4c5cc3
server-addr: 10.27.33.11:8848
namespace: 508584bf-3616-477e-a755-a88d52b4adf9
group: DEFAULT_GROUP
......@@ -2,6 +2,7 @@ package com.sw.mes.itemclean.clean.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sw.mes.core.annotation.Jinko;
import com.sw.mes.core.annotation.TokenNotValidation;
......@@ -48,7 +49,8 @@ public class MaterialBrokenController {
@Autowired
private MaterialBrokenMapper materialBrokenMapper;
@ApiOperation(value = "分页查询列表")
@Jinko(author = "yyl", value = "破碎上料分页查询列表")
@ApiOperation(value = "破碎上料分页查询列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "page", value = "页码", dataType = "integer", paramType = "query"),
......@@ -56,7 +58,7 @@ public class MaterialBrokenController {
@GetMapping("/listByPage")
public Result<ResponsePage<MaterialBrokenDto>> listByPage(ServletRequest request, @ApiIgnore RequestPage requestPage) {
//分页查询
QueryWrapper<MaterialBroken> queryWrapper = DynmaicQueryWrapper.searchFilter(request, MaterialBroken.class);
QueryWrapper<MaterialBroken> queryWrapper = DynmaicQueryWrapper.searchFilter(request, MaterialBroken.class);
Page<MaterialBroken> listPage = materialBrokenService.page(new Page<>(requestPage.getPage(), requestPage.getRows()), queryWrapper);
List<MaterialBrokenDto> dtos = listPage.getRecords().stream()
.map(entity -> toLazyDto(entity))
......@@ -65,10 +67,33 @@ public class MaterialBrokenController {
return ResultGenerator.success(responsePage);
}
@Jinko(author = "yyl", value = "硅料生产记录-破碎上下料分页查询列表")
@ApiOperation(value = "硅料生产记录-破碎上下料分页查询列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "page", value = "页码", dataType = "integer", paramType = "query"),
})
@GetMapping("/upAndDownListByPage")
public Result<ResponsePage<MaterialBrokenUpAndDownDto>> upAndDownListByPage(ServletRequest request, @ApiIgnore RequestPage requestPage) {
//分页查询
ResponsePage<MaterialBrokenUpAndDownDto> responsePage = new ResponsePage<>();
BrokeUpAndDownParamQuery brokeUpAndDownParamQuery = new BrokeUpAndDownParamQuery();
brokeUpAndDownParamQuery.setMaterialName(request.getParameter("search_LIKE_materialName"))
.setMaterialCode(request.getParameter("search_EQ_materialCode"))
.setProductBatchNo(request.getParameter("search_EQ_productBatchNo"))
.setCreateStartTime(request.getParameter("search_GTE_createTime"))
.setCreateEndTime(request.getParameter("search_LTE_createTime"));
IPage<MaterialBrokenUpAndDownDto> iPage = new Page<>(requestPage.getPage(), requestPage.getRows());
IPage<MaterialBrokenUpAndDownDto> brokenUpAndDownDtoIPage = materialBrokenService.queryList(iPage, brokeUpAndDownParamQuery);
responsePage.setRows(brokenUpAndDownDtoIPage.getRecords());
responsePage.setTotal(brokenUpAndDownDtoIPage.getTotal());
return ResultGenerator.success(responsePage);
}
@ApiOperation(value = "获取所有列表")
@GetMapping("/listAll")
public Result<List<MaterialBrokenDto>> listAll(ServletRequest request) {
QueryWrapper<MaterialBroken> queryWrapper = DynmaicQueryWrapper.searchFilter(request, MaterialBroken.class);
QueryWrapper<MaterialBroken> queryWrapper = DynmaicQueryWrapper.searchFilter(request, MaterialBroken.class);
List<MaterialBroken> materialBrokens = materialBrokenService.list(queryWrapper);
List<MaterialBrokenDto> materialBrokenDtos = materialBrokens.stream()
.map(materialBroken -> toLazyDto(materialBroken))
......@@ -78,7 +103,7 @@ public class MaterialBrokenController {
@ApiOperation(value = "详细信息")
@GetMapping("/{id}")
public Result<MaterialBrokenDto> get(@PathVariable @ApiParam(value="设备类型id") Integer id) {
public Result<MaterialBrokenDto> get(@PathVariable @ApiParam(value = "设备类型id") Integer id) {
MaterialBroken materialBroken = materialBrokenService.getById(id);
if (null == materialBroken)
return ResultGenerator.fail("该对象不存在");
......@@ -127,14 +152,15 @@ public class MaterialBrokenController {
/**
* 获取当前设备正在破碎任务信息
*
* @param deviceNo
* @return
*/
@ApiOperation(value = "新版获取当前设备正在破碎任务信息")
@GetMapping("/getCurrentBrokenUpInfo")
public Result<MaterialBrokenCurrentInfoDto> getCurrentBrokenUpInfo(String deviceNo){
public Result<MaterialBrokenCurrentInfoDto> getCurrentBrokenUpInfo(String deviceNo) {
MaterialBroken materialBroken = materialBrokenService.getCurrentBrokenUpInfo(deviceNo);
if (materialBroken == null){
if (materialBroken == null) {
return ResultGenerator.success();
}
MaterialBrokenDto materialBrokenDto = toEagerDto(materialBroken);
......@@ -145,7 +171,7 @@ public class MaterialBrokenController {
// materialBrokenDto.setIsNewBatch(0);
// }
//计算该机台的改生产批次在破碎机台上的余量
BigDecimal subBrokenWeight = materialBrokenService.getSumWeightByBatchNo(materialBroken.getProductBatchNo(),deviceNo);
BigDecimal subBrokenWeight = materialBrokenService.getSumWeightByBatchNo(materialBroken.getProductBatchNo(), deviceNo);
materialBrokenDto.setSubWeight(subBrokenWeight);
MaterialBrokenCurrentInfoDto dto = new MaterialBrokenCurrentInfoDto(materialBrokenDto);
return ResultGenerator.success(dto);
......@@ -154,6 +180,7 @@ public class MaterialBrokenController {
/**
* 新版破碎上料
* materialCleaningPackaging
*
* @param dto
* @param bindingResult
* @return
......@@ -161,8 +188,8 @@ public class MaterialBrokenController {
@Jinko(author = "yyl", value = "新版原料破碎上料")
@ApiOperation(value = "新版原料破碎上料")
@PostMapping("/materialBrokenUp")
public Result materialBrokenUp(@RequestBody @Valid MaterialBrokenUpDto dto, BindingResult bindingResult){
if (bindingResult.hasErrors()){
public Result materialBrokenUp(@RequestBody @Valid MaterialBrokenUpDto dto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultGenerator.fail(bindingResult.getFieldError().getDefaultMessage());
}
materialBrokenService.materialBrokenUp(dto);
......@@ -171,8 +198,8 @@ public class MaterialBrokenController {
@ApiOperation(value = "原料清洗批次完结")
@PostMapping("/materialBrokenEnd")
public Result materialBrokenEnd(@RequestBody @Valid BrokenDownDto dto, BindingResult bindingResult){
if (bindingResult.hasErrors()){
public Result materialBrokenEnd(@RequestBody @Valid BrokenDownDto dto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultGenerator.fail(bindingResult.getFieldError().getDefaultMessage());
}
materialBrokenService.materialBrokenEnd(dto);
......@@ -194,7 +221,6 @@ public class MaterialBrokenController {
@Jinko(author = "yyl", value = "新版接口-破碎打签成箱")
@ApiOperation(value = "新版接口-破碎打签成箱")
@PostMapping("/materialBrokenToPackaging")
@TokenNotValidation
public Result materialBrokenToPackaging(@RequestBody @Valid BrokenToPackDto dto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultGenerator.fail(bindingResult.getFieldError().getDefaultMessage());
......
package com.sw.mes.itemclean.clean.controller;
import com.sw.mes.core.annotation.Jinko;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.itemclean.clean.domain.MaterialStoreSignBox;
import com.sw.mes.itemclean.clean.dto.*;
import com.sw.mes.itemclean.clean.dto.auto.*;
import com.sw.mes.itemclean.clean.service.MaterialCleanToAutoService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@Jinko(author = "yyl", value = "清洗自动化交互接口")
@RestController
@RequestMapping("/clean/materialCleanToAuto")
@Slf4j
@Api(tags = "清洗自动化接口")
public class MaterialCleanToAutoController {
@Autowired
ModelMapper modelMapper;
@Autowired
private MaterialCleanToAutoService materialCleanToAutoService;
@Jinko(author = "yyl", value = "自动化-通过余料批次号或分选后pp号,获取分选后料箱物料信息接口")
@ApiOperation(value = "自动化-通过余料批次号或分选后pp号,获取分选后料箱物料信息接口")
@PostMapping("/getUnpackingInfoByProductBatchNo")
public Result<IOTResponseUnpackingDto> create(@RequestBody @Valid @ApiParam(value = "Dto对象") IOTRequestUnpackingDto iotRequestUnpackingDto) {
IOTResponseUnpackingDto iotResponseUnpackingDto = materialCleanToAutoService.getUnpackingInfoByProductBatchNo(iotRequestUnpackingDto);
return ResultGenerator.success(iotResponseUnpackingDto);
}
@Jinko(author = "yyl", value = "自动化-清洗上料绑定接口")
@ApiOperation(value = "自动化-清洗上料绑定接口")
@PostMapping("/materialCleaningUp")
public Result materialCleaningUp(@RequestBody @Valid @ApiParam(value = "Dto对象") IOTRequestMaterialCleaningUpDto iotRequestMaterialCleaningUpDto) {
materialCleanToAutoService.materialCleaningUp(iotRequestMaterialCleaningUpDto);
return ResultGenerator.success();
}
@Jinko(author = "yyl", value = "自动化-清洗下料异常(MES只负责接收,无实际业务意义)")
@ApiOperation(value = "自动化-清洗下料异常")
@PostMapping("/materialCleaningErrorDown")
public Result materialCleaningErrorDown(@RequestBody @Valid @ApiParam(value = "Dto对象") IOTRequestMaterialCleaningErrorDownDto iotRequestMaterialCleaningErrorDownDto) {
//通过切面入参直接记录到系统日志,无其他业务
materialCleanToAutoService.materialCleaningErrorDown(iotRequestMaterialCleaningErrorDownDto);
return ResultGenerator.success();
}
@Jinko(author = "yyl", value = "自动化-破碎上料(包含清洗下料业务)")
@ApiOperation(value = "自动化-破碎上料")
@PostMapping("/materialCleaningDownAndBrokenUp")
public Result<IOTResponseBrokenUpDto> materialCleaningDownAndBrokenUp(@RequestBody @Valid @ApiParam(value = "Dto对象") IOTRequestMaterialBrokenUpDto iotRequestMaterialBrokenUpDto) {
IOTResponseBrokenUpDto iotResponseBrokenUpDto = materialCleanToAutoService.materialCleaningDownAndBrokenUp(iotRequestMaterialBrokenUpDto);
return ResultGenerator.success(iotResponseBrokenUpDto);
}
@Jinko(author = "yyl", value = "自动化-破碎下料装盒")
@ApiOperation(value = "自动化-破碎下料装盒")
@PostMapping("/materialBrokenDownToPackaging")
public Result materialBrokenDownToPackaging(@RequestBody @Valid @ApiParam(value = "Dto对象") IOTRequestMaterialBrokenDownDto iotRequestMaterialBrokenDownDto) {
materialCleanToAutoService.materialBrokenDownToPackaging(iotRequestMaterialBrokenDownDto);
return ResultGenerator.success();
}
@Jinko(author = "yyl", value = "自动化-成品入库")
@ApiOperation(value = "自动化-成品入库")
@PostMapping("/autoGroupStore")
public Result autoGroupStore(@RequestBody @Valid @ApiParam(value = "Dto对象") IOTRequestMaterialGroupStoreDto iotRequestMaterialGroupStoreDto) {
materialCleanToAutoService.autoGroupStore(iotRequestMaterialGroupStoreDto);
return ResultGenerator.success();
}
@Jinko(author = "yyl", value = "自动化-满托呼叫AGV")
@ApiOperation(value = "自动化-满托呼叫AGV")
@GetMapping("/groupCallAgvById/{id}")
public Result groupCallAgvById(@PathVariable @ApiParam(value = "组托id") Integer id) {
materialCleanToAutoService.groupCallAgvById(id);
return ResultGenerator.success();
}
public MaterialStoreSignBoxDto toLazyDto(MaterialStoreSignBox entity) {
return modelMapper.map(entity, MaterialStoreSignBoxDto.class);
}
public MaterialStoreSignBoxDto toEagerDto(MaterialStoreSignBox entity) {
MaterialStoreSignBoxDto dto = modelMapper.map(entity, MaterialStoreSignBoxDto.class);
return dto;
}
public MaterialStoreSignBox fromDto(MaterialStoreSignBoxDto dto) {
return modelMapper.map(dto, MaterialStoreSignBox.class);
}
public MaterialStoreSignBox fromDto(MaterialStoreSignBoxFromWarehouseDto dto) {
return modelMapper.map(dto, MaterialStoreSignBox.class);
}
}
......@@ -47,7 +47,8 @@ public class MaterialCleaningController {
private MaterialCleaningMapper materialCleaningMapper;
@ApiOperation(value = "分页查询列表")
@Jinko(author = "yyl", value = "硅料生产记录-清洗上下料分页查询列表")
@ApiOperation(value = "硅料生产记录-清洗上下料分页查询列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "page", value = "页码", dataType = "integer", paramType = "query"),
......@@ -207,6 +208,18 @@ public class MaterialCleaningController {
return ResultGenerator.success(materialCleaningService.materialCleaningPackagingBox(dto));
}
@Jinko(author = "yyl", value = "清洗上料-校验花篮号是否被清洗工序占用")
@ApiOperation(value = "清洗上料-校验花篮号是否被清洗工序占用")
@GetMapping("/getNotCleanByBoxNo")
public Result getNotCleanByBoxNo(String boxNo) {
MaterialCleaning cleaning = materialCleaningService.getNotCleanByBoxNo(boxNo);
if (cleaning != null) {
return ResultGenerator.fail("该花篮被清洗上下料工序占用");
} else {
return ResultGenerator.success();
}
}
public MaterialCleaningDto toLazyDto(MaterialCleaning entity) {
return modelMapper.map(entity, MaterialCleaningDto.class);
}
......
......@@ -35,6 +35,7 @@ import javax.servlet.ServletRequest;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
......@@ -66,6 +67,7 @@ public class MaterialGroupController {
public Result<ResponsePage<MaterialGroupDto>> listByPage(ServletRequest request, @ApiIgnore RequestPage requestPage) {
//分页查询
QueryWrapper<MaterialGroup> queryWrapper = DynmaicQueryWrapper.searchFilter(request, MaterialGroup.class);
queryWrapper.orderByDesc("id");
Page<MaterialGroup> listPage = materialGroupService.page(new Page<>(requestPage.getPage(), requestPage.getRows()), queryWrapper);
List<MaterialGroupDto> dtos = listPage.getRecords().stream()
.map(entity -> toLazyDto(entity))
......@@ -146,7 +148,7 @@ public class MaterialGroupController {
}
@Jinko(author = "yyl", value = "硅料组托入库-新版破碎下料-组托入库")
@ApiOperation(value = "硅料组托入库-新版破碎下料-组托入库")
@ApiOperation(value = "硅料组托入库-新版破碎下料-组托入库(暂时不用)")
@PostMapping("/groupStore")
public Result groupStore(@RequestBody @Valid GroupStoreDto dto, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
......@@ -176,6 +178,8 @@ public class MaterialGroupController {
entity.setWeight(dto.getWeight());
entity.setUpdateTime(LocalDateTime.now());
entity.setUpdateUser(BaseContextHandler.getUsername());
entity.setSuppliesGrain(dto.getSuppliesGrain());
entity.setRemark(dto.getRemark());
materialGroupService.saveOrUpdate(entity);
//更新详情表信息,先释放小箱盒数据为未组托,后增加
materialGroupDetailService.updateStatusByGroupId(entity.getId());
......@@ -218,6 +222,20 @@ public class MaterialGroupController {
return ResultGenerator.success(materialGroupService.openGroupToWms(groupNo));
}
@Jinko(author = "yyl", value = "通过托号获取信息")
@ApiOperation(value = "通过托号获取信息")
@GetMapping("/findDataByCleanGroupNo")
@ApiImplicitParams({
@ApiImplicitParam(name = "groupNo", value = "托号", dataType = "String", paramType = "query")
})
public Result get(String groupNo) {
MaterialGroup materialGroup = materialGroupService.getByGroupNo(groupNo);
if (null == materialGroup)
return ResultGenerator.fail("该对象不存在");
return ResultGenerator.success(materialGroup);
}
public MaterialGroupDto toLazyDto(MaterialGroup entity) {
return modelMapper.map(entity, MaterialGroupDto.class);
}
......
......@@ -36,7 +36,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/clean/materialGroupDetail")
@Slf4j
@Api(tags = "组托明细")
@Api(tags = "组托/破碎下料小箱明细")
public class MaterialGroupDetailController {
@Autowired
ModelMapper modelMapper;
......@@ -47,7 +47,8 @@ public class MaterialGroupDetailController {
@Autowired
private MaterialGroupDetailMapper materialGroupDetailMapper;
@ApiOperation(value = "分页查询列表")
@Jinko(author = "yyl", value = "组托/破碎下料小箱分页查询列表")
@ApiOperation(value = "组托/破碎下料小箱分页查询列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "page", value = "页码", dataType = "integer", paramType = "query"),
......
......@@ -5,7 +5,9 @@ import cn.hutool.core.exceptions.ExceptionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sw.mes.core.annotation.Jinko;
import com.sw.mes.core.api.system.YbFeignClients;
import com.sw.mes.core.context.BaseContextHandler;
import com.sw.mes.core.dto.MaterialModelDto;
import com.sw.mes.core.enums.ItemCleanEnums;
import com.sw.mes.core.exception.BusinessException;
import com.sw.mes.core.response.ResponsePage;
......@@ -61,6 +63,9 @@ public class MaterialStoreSignBoxController {
@Autowired
private GenerateBusinessNoService generateBusinessNoService;
@Autowired
private YbFeignClients ybFeignClients;
@Jinko(author = "yyl", value = "硅料审核调拨管理-清洗领料分页查询列表")
@ApiOperation(value = "硅料审核调拨管理-清洗领料分页查询列表")
@ApiImplicitParams({
......@@ -78,7 +83,7 @@ public class MaterialStoreSignBoxController {
public Result<ResponsePage<MaterialStoreSignBoxDto>> listByPage(ServletRequest request, @ApiIgnore RequestPage requestPage) {
//分页查询
QueryWrapper<MaterialStoreSignBox> queryWrapper = DynmaicQueryWrapper.searchFilter(request, MaterialStoreSignBox.class);
queryWrapper.orderByDesc("id");
Page<MaterialStoreSignBox> listPage = materialStoreSignBoxService.page(new Page<>(requestPage.getPage(), requestPage.getRows()), queryWrapper);
List<MaterialStoreSignBoxDto> dtos = listPage.getRecords().stream()
.map(entity -> toLazyDto(entity))
......@@ -117,16 +122,32 @@ public class MaterialStoreSignBoxController {
//校验是否存在同箱号,未使用数据
MaterialStoreSignBox signBox = materialStoreSignBoxService.checkBox(materialStoreSignBoxDto.getBoxNo());
if (null != signBox) {
throw new BusinessException("箱号: " + materialStoreSignBoxDto + "存在领料信息!");
throw new BusinessException("箱号: " + materialStoreSignBoxDto.getBoxNo() + "存在领料信息!");
}
//字段需要与物料主数据对齐
/* Result<MaterialModelDto> result = ybFeignClients.getMaterialByCode(materialStoreSignBoxDto.getMaterialCode());
MaterialModelDto materialModel = result.getData();
if (materialModel == null) {
throw new BusinessException("【" + materialStoreSignBoxDto.getMaterialCode() + "】物料主数据不存在,请检查数据!");
}*/
MaterialStoreSignBox materialStoreSignBox = fromDto(materialStoreSignBoxDto);
//发起入库此处不在生成批次号,入参已经传进来
materialStoreSignBox.setMaterialBoxNo(generateBusinessNoService.generateBoxNo(new BoxNoOperate(ItemCleanEnums.BoxNoType.默认, new BatchNo(materialStoreSignBox.getProductBatchNo()))));
materialStoreSignBox.setBoxNo(materialStoreSignBoxDto.getBoxNo());
materialStoreSignBox.setStatus(ItemCleanEnums.MaterialStatus.待审核.getKey());
materialStoreSignBox.setPickingStatus(ItemCleanEnums.MaterialPickStatus.未领料.getKey());
materialStoreSignBox.setUseStatus(ItemCleanEnums.MaterialUseStatus.未使用.getKey());
materialStoreSignBox.setUsedWeight(BigDecimal.ZERO);
materialStoreSignBox.setWeight(materialStoreSignBoxDto.getWeight());
materialStoreSignBox.setUnusedWeight(materialStoreSignBoxDto.getWeight());
materialStoreSignBox.setCreateTime(LocalDateTime.now());
materialStoreSignBox.setInitiateTime(LocalDateTime.now());
materialStoreSignBox.setInitiateUser(materialStoreSignBoxDto.getCreateUser());
materialStoreSignBox.setSupplier(materialStoreSignBoxDto.getSupplier());
materialStoreSignBox.setSupplierCode(materialStoreSignBoxDto.getSupplierCode());
materialStoreSignBox.setDelFlag(ItemCleanEnums.MaterialDelFlag.未删除.getKey());
materialStoreSignBox.setAufnr(materialStoreSignBoxDto.getAufnr());
materialStoreSignBoxService.saveOrUpdate(materialStoreSignBox);
return ResultGenerator.success();
}
......@@ -159,35 +180,23 @@ public class MaterialStoreSignBoxController {
}
RecyclScanBoxNoParam param = new RecyclScanBoxNoParam();
if (dtos != null && dtos.size() > 0) {
//物料等级
String materialLevel;
//物料档位
String materialGear;
//物料名称
String materialName;
//物料编码
String materialCode;
String productBatchNo = dtos.get(0).getProductBatchNo();
MaterialStoreSignBox storeSignBox = materialStoreSignBoxService.getByProductBatchNo(productBatchNo);
if (null == storeSignBox) {
throw new RuntimeException("不存在批次号为【" + productBatchNo + "】的领料未使用数据");
}
materialLevel = storeSignBox.getMaterialLevel();
materialGear = storeSignBox.getMaterialGear();
materialName = storeSignBox.getMaterialName();
for (MaterialStoreSignBoxDto dto : dtos) {
MaterialStoreSignBox materialStoreSignBox = null;
materialStoreSignBox = materialStoreSignBoxService.getByProductBatchNo(dto.getProductBatchNo());
if (null == materialStoreSignBox) {
throw new RuntimeException("不存在批次号为【" + dto.getProductBatchNo() + "】的领料未使用数据");
}
if (!materialStoreSignBox.getMaterialLevel().equals(materialLevel)) {
throw new RuntimeException("存在" + materialLevel + "和" + materialStoreSignBox.getMaterialLevel() + "不同等级的物料无法合批");
}
if (!materialStoreSignBox.getMaterialGear().equals(materialGear)) {
throw new RuntimeException("存在" + materialGear + "和" + materialStoreSignBox.getMaterialGear() + "不同档位的物料无法合批");
}
if (!materialStoreSignBox.getMaterialName().equals(materialName)) {
throw new RuntimeException("存在" + materialName + "和" + materialStoreSignBox.getMaterialName() + "不同物料名称的物料无法合批");
materialCode = storeSignBox.getMaterialCode();
if (!materialStoreSignBox.getMaterialCode().equals(materialCode)) {
throw new RuntimeException("存在" + materialCode + "和" + materialStoreSignBox.getMaterialCode() + "不同物料编码的物料无法合批");
}
}
//总重量
......@@ -395,4 +404,8 @@ public class MaterialStoreSignBoxController {
public MaterialStoreSignBox fromDto(MaterialStoreSignBoxDto dto) {
return modelMapper.map(dto, MaterialStoreSignBox.class);
}
public MaterialStoreSignBox fromDto(MaterialStoreSignBoxFromWarehouseDto dto) {
return modelMapper.map(dto, MaterialStoreSignBox.class);
}
}
......@@ -2,18 +2,16 @@ package com.sw.mes.itemclean.clean.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sw.mes.core.annotation.Jinko;
import com.sw.mes.core.annotation.TokenNotValidation;
import com.sw.mes.core.response.ResponsePage;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.core.utils.BeanUtil;
import com.sw.mes.core.utils.DynmaicQueryWrapper;
import com.sw.mes.core.utils.RequestPage;
import com.sw.mes.itemclean.clean.domain.MaterialStoreSignBox;
import com.sw.mes.itemclean.clean.dto.FxToBoxInfoPrintDto;
import com.sw.mes.itemclean.clean.dto.MaterialUnpackingDto;
import com.sw.mes.itemclean.clean.dto.*;
import com.sw.mes.itemclean.clean.domain.MaterialUnpacking;
import com.sw.mes.itemclean.clean.mapper.MaterialUnpackingMapper;
import com.sw.mes.itemclean.clean.service.MaterialUnpackingService;
......@@ -49,8 +47,8 @@ public class MaterialUnpackingController {
private MaterialUnpackingMapper materialUnpackingMapper;
@ApiOperation(value = "分页查询列表")
@Jinko(author = "yyl", value = "分选分页查询列表")
@ApiOperation(value = "分选分页查询列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "page", value = "页码", dataType = "integer", paramType = "query"),
......@@ -67,6 +65,30 @@ public class MaterialUnpackingController {
return ResultGenerator.success(responsePage);
}
@Jinko(author = "yyl", value = "硅料生产记录-分选联表分页查询列表")
@ApiOperation(value = "硅料生产记录-分选联表分页查询列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "rows", value = "行数", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "page", value = "页码", dataType = "integer", paramType = "query"),
})
@GetMapping("/listByJoinPage")
public Result<ResponsePage<MaterialUnpackingJoinPageDto>> listByJoinPage(ServletRequest request, @ApiIgnore RequestPage requestPage) {
//分页查询
ResponsePage<MaterialUnpackingJoinPageDto> responsePage = new ResponsePage<>();
MaterialUnpackingParamQuery materialUnpackingParamQuery = new MaterialUnpackingParamQuery();
materialUnpackingParamQuery.setMaterialName(request.getParameter("search_LIKE_materialName"))
.setMaterialCode(request.getParameter("search_EQ_materialCode"))
.setFxProductBatchNo(request.getParameter("search_EQ_fxProductBatchNo"))
.setCreateStartTime(request.getParameter("search_GTE_createTime"))
.setCreateEndTime(request.getParameter("search_LTE_createTime"));
IPage<MaterialUnpackingJoinPageDto> iPage = new Page<>(requestPage.getPage(), requestPage.getRows());
IPage<MaterialUnpackingJoinPageDto> materialUnpackingJoinPageDtoIPage = materialUnpackingService.queryList(iPage, materialUnpackingParamQuery);
responsePage.setRows(materialUnpackingJoinPageDtoIPage.getRecords());
responsePage.setTotal(materialUnpackingJoinPageDtoIPage.getTotal());
return ResultGenerator.success(responsePage);
}
@ApiOperation(value = "获取所有列表")
@GetMapping("/listAll")
public Result<List<MaterialUnpackingDto>> listAll(ServletRequest request) {
......@@ -166,6 +188,17 @@ public class MaterialUnpackingController {
}
}
@Jinko(author = "yyl", value = "通过分选pp批次号获取分选数据")
@ApiOperation(value = "通过分选pp批次号获取分选数据")
@GetMapping("/getInfoByFxProductBatchNo")
public Result<MaterialUnpacking> getInfoByFxProductBatchNo(String productBatchNo) {
MaterialUnpacking unpacking = materialUnpackingService.getFxProductBatchNo(productBatchNo);
if (unpacking == null) {
return ResultGenerator.fail("不存在分选物料信息");
} else {
return ResultGenerator.success(unpacking);
}
}
......
......@@ -55,7 +55,7 @@ public class CleanReworking {
@ApiModelProperty("电阻档位")
private String materialGear;
@ApiModelProperty("生产批次")
@ApiModelProperty("生产pp批次")
private String productBatchNo;
@ApiModelProperty("返工来源")
......@@ -75,4 +75,10 @@ public class CleanReworking {
@ApiModelProperty("更新时间")
private Date updateDate;
@ApiModelProperty("来源生产批次")
private String sourceProductBatchNo;
@ApiModelProperty(value = "工单号")
private String workOrderNo;
}
......@@ -95,4 +95,13 @@ public class MaterialCleaning implements Serializable {
@ApiModelProperty("父箱号id")
Integer parentId;
@ApiModelProperty("下料人")
private String downUser;
@ApiModelProperty("下料时间")
private LocalDateTime downTime;
@ApiModelProperty("下料重量")
private BigDecimal downWeight;
}
......@@ -121,4 +121,18 @@ public class MaterialGroup implements Serializable {
@ApiModelProperty("发起入库时间")
private LocalDateTime warehousingTime;
@ApiModelProperty("起始库位")
private String warehouseCode;
@ApiModelProperty("终止库位")
private String nextWarehouseCode;
@ApiModelProperty(value = "粒径范围")
private String suppliesGrain;
@ApiModelProperty(value = "托位号(物理起始位置)")
private String trayNumber;
@ApiModelProperty(value = "实物托盘号")
private String trayCode;
}
......@@ -114,4 +114,9 @@ public class MaterialGroupDetail implements Serializable {
@ApiModelProperty("托号")
private String groupNo;
@ApiModelProperty("破碎id")
private Integer brokenId;
@ApiModelProperty(value = "粒径范围")
private String suppliesGrain;
}
......@@ -147,4 +147,10 @@ public class MaterialStoreSignBox implements Serializable {
@ApiModelProperty("去向")
private String hasGone;
@ApiModelProperty(value = "物料主数据供应商")
private String supplier;
@ApiModelProperty(value = "物料主数据供应商Code")
private String supplierCode;
}
......@@ -56,7 +56,7 @@ public class MaterialUnpacking implements Serializable {
@ApiModelProperty("领料的生产批次")
private String productBatchNo;
@ApiModelProperty("分选生产批次")
@ApiModelProperty("分选pp批次")
private String fxProductBatchNo;
@ApiModelProperty("物料属性:1原生多晶、2回收料、3返工料、4落地料、5清洗料、6破碎料")
......
package com.sw.mes.itemclean.clean.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 破碎上下料查询参数
*/
@Data
@Accessors(chain = true)
public class BrokeUpAndDownParamQuery {
/**
* pp号
*/
private String productBatchNo;
/**
* 物料名称
*/
private String materialName;
/**
* 物料编码
*/
private String materialCode;
/**
* 开始时间开始
*/
private String createStartTime;
/**
* 结束时间结束
*/
private String createEndTime;
}
......@@ -78,4 +78,7 @@ public class BrokenToPackDto {
@ApiModelProperty("上料花篮/箱号")
private String boxNo;
@ApiModelProperty(value = "粒径范围")
private String suppliesGrain;
}
......@@ -72,6 +72,12 @@ public class CleanReworkingDto implements Serializable {
@ApiModelProperty("返工重量")
private BigDecimal weight;
@ApiModelProperty("来源生产批次")
private String sourceProductBatchNo;
@ApiModelProperty(value = "工单号")
private String workOrderNo;
@ApiModelProperty("明细列表")
private List<CleanReworkingDetailDto> cleanReworkingDetailDtoList;
}
......@@ -28,8 +28,8 @@ public class FxToBoxInfoPrintDto implements Serializable {
@ApiModelProperty("箱号")
private String boxNo;
@ApiModelProperty("当前生产批次")
private String currentProductBatchNo;
@ApiModelProperty("分选批次")
private String fxProductBatchNo;
@ApiModelProperty("追溯厂家")
private String fromMark;
......@@ -40,6 +40,9 @@ public class FxToBoxInfoPrintDto implements Serializable {
@ApiModelProperty("硅料名称")
private String materialName;
@ApiModelProperty("物料编号")
private String materialCode;
@ApiModelProperty("等级")
private String materialLevel;
......@@ -56,10 +59,19 @@ public class FxToBoxInfoPrintDto implements Serializable {
private String createUser;
@ApiModelProperty("生产日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("余料生产批次")
private String productBatchNo;
@ApiModelProperty(value = "班组")
private String classNo;
@ApiModelProperty("去向")
private String hasGone;
}
......@@ -21,4 +21,7 @@ public class GroupStoreDto {
@ApiModelProperty(value = "打托备注")
String remark;
@ApiModelProperty(value = "粒径范围")
String suppliesGrain;
}
package com.sw.mes.itemclean.clean.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sw.mes.itemclean.clean.utils.LocalDateStringConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 组托明细
* </p>
*
* @author liuzemin
* @since 2022-11-10
*/
@Getter
@Setter
@ApiModel(value = "MaterialBrokenUpAndDownDto", description = "关联破碎上料+破碎下料组托明细")
public class MaterialBrokenUpAndDownDto implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("破碎上料id")
private Integer upId;
@ApiModelProperty("上料箱号")
@ExcelProperty(value = "上料箱号")
private String upBoxNo;
@ApiModelProperty("上料重量")
@ExcelProperty(value = "上料重量")
private BigDecimal upWeight;
@ApiModelProperty("上料时间")
@ExcelProperty(value = "上料时间", converter = LocalDateStringConverter.class)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime upCreateTime;
@ApiModelProperty("上料人")
@ExcelProperty(value = "上料人")
private String upCreateUser;
@ApiModelProperty("分选pp批次")
@ExcelProperty(value = "分选pp批次")
private String productBatchNo;
@ApiModelProperty("下料小箱盒号")
@ExcelProperty(value = "下料箱号")
private String downBoxNo;
@ApiModelProperty("下料id")
private Integer downId;
@ApiModelProperty("下料重量")
@ExcelProperty(value = "下料重量")
private BigDecimal DownWeight;
@ApiModelProperty("物料名称")
@ExcelProperty(value = "物料名称")
private String materialName;
@ApiModelProperty("物料编号")
@ExcelProperty(value = "物料编号")
private String materialCode;
@ApiModelProperty("物料等级")
@ExcelProperty(value = "物料等级")
private String materialLevel;
@ApiModelProperty("物料型号")
@ExcelProperty(value = "物料型号")
private String materialModel;
@ApiModelProperty("电阻档位")
@ExcelProperty(value = "电阻档位")
private String materialGear;
@ApiModelProperty("下料人")
@ExcelProperty(value = "下料人")
private String downUser;
@ApiModelProperty("下料时间")
@ExcelProperty(value = "下料时间", converter = LocalDateStringConverter.class)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime downCreateTime;
@ApiModelProperty("组托号")
@ExcelProperty(value = "托号")
private String groupNo;
@ApiModelProperty("组托id")
private Integer groupId;
}
......@@ -49,7 +49,7 @@ public class MaterialCleaningDto implements Serializable {
@ApiModelProperty("电阻档位")
private String materialGear;
@ApiModelProperty("生产批次")
@ApiModelProperty("分选pp生产批次")
private String productBatchNo;
@ApiModelProperty("批次完结 1完结 0未完结")
......@@ -58,10 +58,10 @@ public class MaterialCleaningDto implements Serializable {
@ApiModelProperty("设备号")
private String deviceNo;
@ApiModelProperty("创建人")
@ApiModelProperty("创建人-清洗上料人")
private String createUser;
@ApiModelProperty("创建时间")
@ApiModelProperty("创建时间-清洗上料时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
......@@ -72,11 +72,26 @@ public class MaterialCleaningDto implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
@ApiModelProperty("花篮载具号")
private String boxNo;
@ApiModelProperty("下料人")
private String downUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("下料时间")
private LocalDateTime downTime;
@ApiModelProperty("下料重量")
private BigDecimal downWeight;
@ApiModelProperty("逻辑删除标记")
private Integer delFlag;
@ApiModelProperty("是否有新批次")
private Integer isNewBatch; //1:有新批次 。 2:无新批次
@ApiModelProperty("清洗状态 0 清洗上料 1 清洗下料 2 拆花篮成箱 3 待破碎")
private Integer status;
}
......@@ -107,6 +107,7 @@ public class MaterialGroupDto implements Serializable {
private String warehousingUser;
@ApiModelProperty("发起入库时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime warehousingTime;
}
......@@ -31,6 +31,11 @@ public class MaterialGroupEditDto implements Serializable {
@ApiModelProperty("重量")
private BigDecimal weight;
@ApiModelProperty(value = "粒径范围")
private String suppliesGrain;
@ApiModelProperty("打托备注")
private String remark;
@ApiModelProperty(value = "组托详情")
List<MaterialGroupDetail> details;
......
......@@ -65,14 +65,14 @@ public class MaterialStoreSignBoxDto implements Serializable {
private String createUser;
@ApiModelProperty("创建时间")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@ApiModelProperty("更新人")
private String updateUser;
@ApiModelProperty("更新时间")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
@ApiModelProperty("逻辑删除标记")
......@@ -110,22 +110,32 @@ public class MaterialStoreSignBoxDto implements Serializable {
@ApiModelProperty("合批人")
private String blendingUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("合批时间")
private LocalDateTime blendingTime;
@ApiModelProperty("审核人")
private String examineUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("审核时间")
private LocalDateTime examineTime;
@ApiModelProperty("发起人")
private String initiateUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("发起时间")
private LocalDateTime initiateTime;
@ApiModelProperty("去向")
private String hasGone;
@ApiModelProperty(value = "物料主数据供应商")
private String supplier;
@ApiModelProperty(value = "物料主数据供应商Code")
private String supplierCode;
}
package com.sw.mes.itemclean.clean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 线边仓传入清洗数据
* </p>
*
* @author liuzemin
* @since 2022-11-10
*/
@Getter
@Setter
@ApiModel(value = "MaterialStoreSignBox对象", description = "打签箱待存(待扫码领料)")
public class MaterialStoreSignBoxFromWarehouseDto implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private Integer id;
@ApiModelProperty("重量")
private BigDecimal weight;
@ApiModelProperty("成箱箱号")
private String materialBoxNo;
@ApiModelProperty("生产批次号")
private String productBatchNo;
@ApiModelProperty(value = "回收料托号")
private String trayNo;
@ApiModelProperty("物料编号")
private String materialCode;
@ApiModelProperty("物料名称")
private String materialName;
@ApiModelProperty("物料等级")
private String materialLevel;
@ApiModelProperty("物料型号")
private String materialModel;
@ApiModelProperty("物料档位")
private String materialGear;
@ApiModelProperty("物料类型 1原生多晶2回收料3落地料4返工料5清洗料6破碎料")
private Integer materialType;
@ApiModelProperty("是否被领料 1是 0否 (被领料的才能进入加工工序)")
private Integer pickingStatus;
@ApiModelProperty("创建人")
private String createUser;
@ApiModelProperty("创建时间")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@ApiModelProperty("更新人")
private String updateUser;
@ApiModelProperty("更新时间")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
@ApiModelProperty("逻辑删除标记")
private Integer delFlag;
@ApiModelProperty("是否成箱 0否 1是")
private Integer isPack;
@ApiModelProperty("是否空箱 0否 1是")
private Integer isEmptyBox;
@ApiModelProperty("ERP订单编号")
private String aufnr;
@ApiModelProperty(value = "卡板箱号")
String boxNo;
@ApiModelProperty("已使用重量")
private BigDecimal usedWeight;
@ApiModelProperty("剩余重量")
private BigDecimal unusedWeight;
@ApiModelProperty("审核状态 0 待审核 1 已接收 2已拒收")
private Integer status;
@ApiModelProperty("使用状态 1是 0否")
private Integer useStatus;
@ApiModelProperty("合批父id")
Integer parentId;
@ApiModelProperty("合批批次号")
private String blendingProductBatchNo;
@ApiModelProperty("合批人")
private String blendingUser;
@ApiModelProperty("合批时间")
private LocalDateTime blendingTime;
@ApiModelProperty("审核人")
private String examineUser;
@ApiModelProperty("审核时间")
private LocalDateTime examineTime;
@ApiModelProperty("发起人")
private String initiateUser;
@ApiModelProperty("发起时间")
private LocalDateTime initiateTime;
@ApiModelProperty("去向")
private String hasGone;
@ApiModelProperty(value = "物料主数据供应商")
private String supplier;
@ApiModelProperty(value = "物料主数据供应商Code")
private String supplierCode;
}
package com.sw.mes.itemclean.clean.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 分选拆箱
* </p>
*
* @author liuzemin
* @since 2022-11-10
*/
@Getter
@Setter
@ApiModel(value = "MaterialUnpackingJoinPageDto对象", description = "分选拆箱列表页")
public class MaterialUnpackingJoinPageDto implements Serializable {
//----------分选前
@ApiModelProperty("回收料表-分选前-掺杂剂")
private String dopant;
@ApiModelProperty("回收料表-分选前-成本中心")
private String kostl;
@ApiModelProperty("回收料表-分选前-定向标识")
private String directionalSign;
@ApiModelProperty("回收料表-分选前-导电型号")
private String conductionType;
@ApiModelProperty("回收料表-分选前-车间")
private String workShop;
//--------领料表
@ApiModelProperty("领料表主键")
private Integer id;
@ApiModelProperty("重量")
private BigDecimal weight;
@ApiModelProperty("成箱箱号")
private String materialBoxNo;
@ApiModelProperty("生产批次号")
private String productBatchNo;
@ApiModelProperty("物料编号")
private String materialCode;
@ApiModelProperty("物料名称")
private String materialName;
@ApiModelProperty("物料等级")
private String materialLevel;
@ApiModelProperty("物料型号")
private String materialModel;
@ApiModelProperty("物料档位")
private String materialGear;
@ApiModelProperty("物料类型 1原生多晶2回收料3落地料4返工料5清洗料6破碎料")
/**
* {@link com.sw.mes.core.enums.ItemCleanEnums.MaterialType}
*/
private Integer materialType;
@ApiModelProperty("物料来源 1:清洗 2:循环料破碎 3:多晶破碎 4:分选")
private Integer materialResource;
@ApiModelProperty("是否被领料 1是 0否")
/**
* (被领料的才能进入加工工序)
*/
private Integer pickingStatus;
@ApiModelProperty("创建人")
private String createUser;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("更新人")
private String updateUser;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
@ApiModelProperty("逻辑删除标记")
@TableLogic
private Integer delFlag;
@ApiModelProperty("是否成箱 0否 1是")
private Integer isPack;
@ApiModelProperty("是否空箱 0否 1是")
private Integer isEmptyBox;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("ERP工单")
private String aufnr;
@ApiModelProperty(value = "卡板箱号")
private String boxNo;
/**
* erp库位
*/
@ApiModelProperty("erp库位")
private String erpWarehouseCode;
@ApiModelProperty("已使用重量")
private BigDecimal usedWeight;
@ApiModelProperty("剩余重量")
private BigDecimal unusedWeight;
@ApiModelProperty("审核状态 0 待审核 1 已接收 2已拒收")
private Integer status;
@ApiModelProperty("使用状态 0未使用 1已使用 2合批 3分选 4已清空")
private Integer useStatus;
@ApiModelProperty("合批父id")
Integer parentId;
@ApiModelProperty("合批批次号")
private String blendingProductBatchNo;
@ApiModelProperty("合批人")
private String blendingUser;
@ApiModelProperty("合批时间")
private LocalDateTime blendingTime;
@ApiModelProperty("审核人")
private String examineUser;
@ApiModelProperty("审核时间")
private LocalDateTime examineTime;
@ApiModelProperty("发起人")
private String initiateUser;
@ApiModelProperty("发起时间")
private LocalDateTime initiateTime;
@ApiModelProperty("去向")
private String hasGone;
@ApiModelProperty(value = "物料主数据供应商")
private String supplier;
@ApiModelProperty(value = "物料主数据供应商Code")
private String supplierCode;
//分选后-分选表--------
@ApiModelProperty("分选后-主键")
private Integer muId;
@ApiModelProperty("分选后-成箱号-分选批号")
private String muMaterialBoxNo;
@ApiModelProperty("分选后-成箱重量")
private BigDecimal muWeight;
@ApiModelProperty("分选后-物料编号")
private String muMaterialCode;
@ApiModelProperty("分选后-物料名称")
private String muMaterialName;
@ApiModelProperty("分选后-物料等级")
private String muMaterialLevel;
@ApiModelProperty("分选后-物料型号")
private String muMaterialModel;
@ApiModelProperty("分选后-电阻档位")
private String muMaterialGear;
@ApiModelProperty("分选后-领料的生产批次")
private String muProductBatchNo;
@ApiModelProperty("分选后-分选生产批次")
private String muFxProductBatchNo;
@ApiModelProperty("分选后-物料属性:1原生多晶、2回收料、3返工料、4落地料、5清洗料、6破碎料")
/**
* {@link com.sw.mes.core.enums.ItemCleanEnums.MaterialType}
*/
private Integer muMaterialType;
@ApiModelProperty("分选后-暂存标记")
private Integer muStagingFlag;
@ApiModelProperty("分选后-逻辑删除标记")
@TableLogic
private Integer muDelFlag;
@ApiModelProperty("分选后-创建人")
private String muCreateUser;
@ApiModelProperty("分选后-创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime muCreateTime;
@ApiModelProperty("分选后-更新人")
private String muUpdateUser;
@ApiModelProperty("分选后-更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime muUpdateTime;
@ApiModelProperty(value = "分选后-卡板箱号")
private String muBoxNo;
@ApiModelProperty("分选后-载具皮重")
private String muBoxWeight;
@ApiModelProperty("分选后-载具类型")
private String muTypeName;
@ApiModelProperty("分选后-已使用重量")
private BigDecimal muUsedWeight;
@ApiModelProperty("分选后-剩余重量")
private BigDecimal muUnusedWeight;
@ApiModelProperty("分选后-领料表中拆箱箱号")
private String muUnpackingBoxNo;
@ApiModelProperty("分选后-其他异物重量")
private BigDecimal muOtherWeight;
@ApiModelProperty("分选后-使用状态 0未使用 1已使用 2已清空")
private Integer muUseStatus;
@ApiModelProperty("分选后-ERP工单")
private String muAufnr;
@ApiModelProperty("分选后-去向")
private String muHasGone;
}
package com.sw.mes.itemclean.clean.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 组托详情查询参数
*/
@Data
@Accessors(chain = true)
public class MaterialUnpackingParamQuery {
/**
* pp号
*/
private String fxProductBatchNo;
/**
* 物料名称
*/
private String materialName;
/**
* 物料编码
*/
private String materialCode;
/**
* 开始时间开始
*/
private String createStartTime;
/**
* 结束时间结束
*/
private String createEndTime;
}
package com.sw.mes.itemclean.clean.dto.auto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @author liuzemin
* @date 2022/11/16 9:42
* @description
*/
@Data
public class IOTRequestMaterialBrokenDownDto {
@ApiModelProperty(value = "设备号", required = true)
@NotNull(message = "设备号不能空")
private String deviceNo;
@ApiModelProperty(value = "清洗花篮号/分选箱号", required = true)
@NotNull(message = "载具号不能空")
private String boxNo;
@ApiModelProperty(value = "破碎上料位标识", required = true)
private String brokenUpCode;
@ApiModelProperty(value = "工位号", required = true)
private String stationNumber;
@ApiModelProperty(value = "下料装盒箱码", required = true)
private String materialBoxNo;
@ApiModelProperty(value = "下料装盒重量", required = true)
private BigDecimal weight;
@ApiModelProperty(value = "粒径范围", required = true)
private String suppliesGrain;
}
package com.sw.mes.itemclean.clean.dto.auto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @author liuzemin
* @date 2022/11/16 9:42
* @description
*/
@Data
public class IOTRequestMaterialBrokenUpDto {
@ApiModelProperty(value = "设备号", required = true)
@NotNull(message = "设备号不能空")
private String deviceNo;
@ApiModelProperty(value = "清洗花篮号/分选箱号", required = true)
@NotNull(message = "载具号不能空")
private String boxNo;
@ApiModelProperty(value = "破碎上料位标识", required = true)
private String brokenUpCode;
@ApiModelProperty(value = "IOT唯一标识", required = true)
private String uniqueCode;
}
package com.sw.mes.itemclean.clean.dto.auto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @author liuzemin
* @date 2022/11/16 9:42
* @description
*/
@Data
public class IOTRequestMaterialCleaningErrorDownDto {
@ApiModelProperty(value = "设备号", required = true)
@NotNull(message = "设备号不能空")
private String deviceNo;
@ApiModelProperty(value = "花篮号", required = true)
@NotNull(message = "花篮号不能空")
private String basketNo;
@ApiModelProperty(value = "清洗下料位标识", required = true)
private String cleanDownCode;
@ApiModelProperty(value = "IOT唯一标识", required = true)
private String uniqueCode;
@ApiModelProperty(value = "异常信息", required = true)
private String errorMessage;
}
package com.sw.mes.itemclean.clean.dto.auto;
import com.sw.mes.itemclean.clean.dto.BasketInfoDto;
import com.sw.mes.itemclean.clean.dto.BoxInfoDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
/**
* @author liuzemin
* @date 2022/11/16 9:42
* @description
*/
@Data
public class IOTRequestMaterialCleaningUpDto {
@ApiModelProperty(value = "设备号", required = true)
@NotNull(message = "设备号不能空")
private String deviceNo;
@ApiModelProperty(value = "上料重量", required = true)
@NotNull(message = "分选pp批次不能空")
private BigDecimal weight;
@ApiModelProperty(value = "分选pp批次", required = true)
@NotNull(message = "分选pp批次")
private String fxProductBatchNo;
@ApiModelProperty(value = "花篮号", required = true)
@NotNull(message = "花篮号不能空")
private String basketNo;
@ApiModelProperty(value = "清洗上料位标识", required = true)
private String cleanUpCode;
@ApiModelProperty(value = "IOT唯一标识", required = true)
private String uniqueCode;
}
package com.sw.mes.itemclean.clean.dto.auto;
import com.sw.mes.itemclean.clean.dto.GroupStoreDetailDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
/**
* @author liuzemin
* @date 2022/11/16 9:42
* @description
*/
@Data
public class IOTRequestMaterialGroupStoreDto {
@ApiModelProperty(value = "托位号(物理起始位置)", required = true)
private String trayNumber;
@ApiModelProperty(value = "实物托盘号", required = true)
private String trayCode;
@ApiModelProperty(value = "扫箱盒信息集合", required = true)
List<String> detailBoxs;
/**
* 此重量只记录在日志里,实际还是mes端通过详情累加计算总重量
*/
@ApiModelProperty(value = "整托重量", required = true)
private BigDecimal weight;
}
package com.sw.mes.itemclean.clean.dto.auto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @author liuzemin
* @date 2022/11/16 10:15
* @description
*/
@Data
public class IOTRequestUnpackingDto {
@ApiModelProperty(value = "当前余料批次号或分选pp批次号 (人工模式,是分选pp号;自动模式,是余料批次号)", required = true)
@NotNull(message = "批次号/pp号不能空")
private String currentProductBatchNo;
@ApiModelProperty(value = "模式标识 0自动 1人工", required = true)
@NotNull(message = "模式标识不能空")
private Integer autoModel;
}
package com.sw.mes.itemclean.clean.dto.auto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* <p>
* 分选拆箱
* </p>
*
* @author liuzemin
* @since 2022-11-10
*/
@Getter
@Setter
@ApiModel(value = "IOTResponseBrokenUpDto对象", description = "IOT获取破碎上料信息")
@Accessors(chain = true)
public class IOTResponseBrokenUpDto implements Serializable {
@ApiModelProperty("上料重量")
private BigDecimal weight;
@ApiModelProperty("物料编号")
private String materialCode;
@ApiModelProperty("物料名称")
private String materialName;
@ApiModelProperty("物料等级")
private String materialLevel;
@ApiModelProperty("物料型号")
private String materialModel;
@ApiModelProperty("电阻档位")
private String materialGear;
@ApiModelProperty("分选pp批次")
private String fxProductBatchNo;
@ApiModelProperty(value = "载具箱号")
private String boxNo;
}
package com.sw.mes.itemclean.clean.dto.auto;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import javax.persistence.Access;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 分选拆箱
* </p>
*
* @author liuzemin
* @since 2022-11-10
*/
@Getter
@Setter
@ApiModel(value = "IOTResponseUnpackingDto对象", description = "IOT获取分选信息")
@Accessors(chain = true)
public class IOTResponseUnpackingDto implements Serializable {
@ApiModelProperty("成箱重量")
private BigDecimal weight;
@ApiModelProperty("物料编号")
private String materialCode;
@ApiModelProperty("物料名称")
private String materialName;
@ApiModelProperty("物料等级")
private String materialLevel;
@ApiModelProperty("物料型号")
private String materialModel;
@ApiModelProperty("电阻档位")
private String materialGear;
@ApiModelProperty("领料的生产批次")
private String productBatchNo;
@ApiModelProperty("分选pp批次")
private String fxProductBatchNo;
@ApiModelProperty(value = "卡板箱号")
private String boxNo;
@ApiModelProperty("已使用重量")
private BigDecimal usedWeight;
@ApiModelProperty("剩余重量")
private BigDecimal unusedWeight;
@ApiModelProperty("去向")
private String hasGone;
}
package com.sw.mes.itemclean.clean.dto.auto;
import com.sw.mes.itemclean.clean.domain.MaterialGroupDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author liuzemin
* @date 2022/11/16 9:42
* @description
*/
@Data
public class MesRequestMcsAgvDto {
@ApiModelProperty(value = "托位号(物理起始位置)")
private String trayNumber;
@ApiModelProperty(value = "实物托盘号")
private String trayCode;
@ApiModelProperty(value = "组托成托号")
private String groupNo;
@ApiModelProperty(value = "组托详情")
List<MaterialGroupDetail> details;
@ApiModelProperty(value = "整托重量")
private BigDecimal weight;
}
package com.sw.mes.itemclean.clean.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sw.mes.itemclean.clean.domain.MaterialBroken;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sw.mes.itemclean.clean.dto.BrokeUpAndDownParamQuery;
import com.sw.mes.itemclean.clean.dto.MaterialBrokenUpAndDownDto;
import org.springframework.stereotype.Repository;
/**
......@@ -16,4 +19,6 @@ import org.springframework.stereotype.Repository;
public interface MaterialBrokenMapper extends BaseMapper<MaterialBroken> {
String getSumWeightByBatchNo(String productBatchNo,String deviceNo);
IPage<MaterialBrokenUpAndDownDto> queryList(IPage<MaterialBrokenUpAndDownDto> iPage, BrokeUpAndDownParamQuery query);
}
package com.sw.mes.itemclean.clean.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sw.mes.itemclean.clean.domain.MaterialUnpacking;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sw.mes.itemclean.clean.dto.GroupDetailParamQuery;
import com.sw.mes.itemclean.clean.dto.MaterialGroupToDetailDto;
import com.sw.mes.itemclean.clean.dto.MaterialUnpackingJoinPageDto;
import com.sw.mes.itemclean.clean.dto.MaterialUnpackingParamQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* <p>
* 分选拆箱 Mapper 接口
......@@ -14,4 +21,6 @@ import org.springframework.stereotype.Repository;
@Repository
public interface MaterialUnpackingMapper extends BaseMapper<MaterialUnpacking> {
IPage<MaterialUnpackingJoinPageDto> queryList(@Param("iPage") IPage<MaterialUnpackingJoinPageDto> iPage, @Param("query") MaterialUnpackingParamQuery query);
}
......@@ -344,14 +344,16 @@ public class GenerateBusinessNoService {
}
/**
* 分选箱号(分选批号)生成方法
*PP+年(倒数2位)+月份(两位)+日(两位)+4位流水号;每日00点开始生成流水号
* @param mark 特殊标识
* 返工/分选箱号(分选批号)生成方法
* PP+年(倒数2位)+月份(两位)+日(两位)+4位流水号;每日00点开始生成流水号
*
* @param mark 特殊标识
* @return
*/
public String generateBoxNoForUnpack( String mark) {
return mark + genPPSerialNumber(datePPString());
public String generateBoxNoForUnpack(String mark) {
return mark + datePPString() + genPPSerialNumber(datePPString());
}
/**
* 拆花篮装箱(批号)生成方法
*
......@@ -424,6 +426,7 @@ public class GenerateBusinessNoService {
int intMonth = instance.get(Calendar.MONTH) + 1;
String strMonth = Convert.toStr(intMonth);
strMonth = org.apache.commons.lang3.StringUtils.leftPad(strMonth, 2, "0");
String strDay = Convert.toStr(instance.get(Calendar.DAY_OF_MONTH));
......@@ -432,4 +435,12 @@ public class GenerateBusinessNoService {
return strYear + strMonth + supplementZeroStrDay;
}
/**
* 托号规则:L+基地名称+年倒数两位+月份(2位)+日(2位)+4位流水号(根据日期0点开始计算)
* @return
*/
public String generateForGroupNo() {
return "L" + "TY" + datePPString() + genPPSerialNumber("L" + "TY" + datePPString());
}
}
package com.sw.mes.itemclean.clean.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sw.mes.itemclean.clean.domain.MaterialBroken;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sw.mes.itemclean.clean.domain.MaterialGroupDetail;
import com.sw.mes.itemclean.clean.domain.MaterialStoreSignBox;
import com.sw.mes.itemclean.clean.dto.BoxInfoDto;
import com.sw.mes.itemclean.clean.dto.BrokenDownDto;
import com.sw.mes.itemclean.clean.dto.BrokenToPackDto;
import com.sw.mes.itemclean.clean.dto.MaterialBrokenUpDto;
import com.sw.mes.itemclean.clean.dto.*;
import java.math.BigDecimal;
import java.util.List;
......@@ -24,7 +22,7 @@ public interface MaterialBrokenService extends IService<MaterialBroken> {
MaterialBroken getCurrentBrokenUpInfo(String deviceNo);
void materialBrokenUp(MaterialBrokenUpDto dto);
MaterialBroken materialBrokenUp(MaterialBrokenUpDto dto);
void materialBrokenEnd(BrokenDownDto dto);
......@@ -45,4 +43,6 @@ public interface MaterialBrokenService extends IService<MaterialBroken> {
BoxInfoDto getInfoByBoxNo(String boxNo);
MaterialBroken getBrokenInfoByBoxNo(String boxNo);
IPage<MaterialBrokenUpAndDownDto> queryList(IPage<MaterialBrokenUpAndDownDto> iPage, BrokeUpAndDownParamQuery brokeUpAndDownParamQuery);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment