feat: bug-890 成品出入库相关业务单据拆分
This commit is contained in:
parent
6785e797a5
commit
3b6d708fc1
|
|
@ -114,6 +114,7 @@ public class InProduceOrderController extends BaseController {
|
|||
public ApiResult<Long> save(@Valid @RequestBody InProduceOrderSaveQO request) {
|
||||
if (Objects.isNull(request.getId())) {
|
||||
WmsInProduceOrder order = new WmsInProduceOrder()
|
||||
.setDataType(request.getDataType())
|
||||
.setNo(serialNumberControllerService.generateSerialNumber(8))
|
||||
.setOrderNo(request.getAufnr())
|
||||
.setList(request.getList())
|
||||
|
|
@ -255,11 +256,11 @@ public class InProduceOrderController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
private String generateQRContent(DeliverNormalOrderItemDTO order,String indexNo){
|
||||
private String generateQRContent(DeliverNormalOrderItemDTO order, String indexNo) {
|
||||
String content = StrUtil.format("{}${}${}${}${}${}${}${}${}"
|
||||
, order.getPrintNo(), order.getExternalOrderNo(),order.getRowNo(),order.getMaterialNo(),order.getPrintNum()
|
||||
, order.getPrintNo(), order.getExternalOrderNo(), order.getRowNo(), order.getMaterialNo(), order.getPrintNum()
|
||||
, order.getMaterialDesc(), order.getSupplierCode(), order.getBatchNo(), Optional.ofNullable(indexNo).orElse(""));
|
||||
log.debug("二维码内容:"+ content);
|
||||
log.debug("二维码内容:" + content);
|
||||
return content;
|
||||
}
|
||||
|
||||
|
|
@ -294,6 +295,7 @@ public class InProduceOrderController extends BaseController {
|
|||
}
|
||||
InProduceOrderItemVO first = list.get(0);
|
||||
Map<String, String> base = new HashMap<>();
|
||||
base.put("title", order.getDataType() == 0 ? "半成品入库单" : "成品入库单");
|
||||
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
||||
base.put("factoryNo", first.getFactoryNo());
|
||||
base.put("warehouseNo", first.getWarehouseNo());
|
||||
|
|
@ -434,7 +436,7 @@ public class InProduceOrderController extends BaseController {
|
|||
}
|
||||
|
||||
private void syncStorage(InProduceOrderItemVO it, Collection<String> binNos) {
|
||||
if(CollectionUtil.isEmpty(binNos))
|
||||
if (CollectionUtil.isEmpty(binNos))
|
||||
return;
|
||||
|
||||
produceOrderItemService.lambdaUpdate()
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.nflg.wms.common.pojo.dto.InventoryDTO;
|
|||
import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
||||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.*;
|
||||
import com.nflg.wms.common.util.EecExcelUtil;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.WmsOutProduce;
|
||||
|
|
@ -40,7 +41,9 @@ import org.redisson.api.RLock;
|
|||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.ttzero.excel.entity.ListMapSheet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -430,6 +433,7 @@ public class OutProduceController extends BaseController {
|
|||
// list.add(new WmsOutProduceItem().setMatnr(RandomUtil.randomNumbers(10)));
|
||||
// }
|
||||
Map<String, String> base = new HashMap<>();
|
||||
base.put("title", order.getDataType() == 0 ? "生产订单领料单" : "成品发货领料单");
|
||||
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
||||
base.put("qrcode", QRCodeUtil.generateQRCodeBase64(order.getNo(), 100, 100));
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
|
|
@ -488,6 +492,7 @@ public class OutProduceController extends BaseController {
|
|||
|
||||
/**
|
||||
* 导出领料出库单
|
||||
* @param id 出库单id
|
||||
*/
|
||||
@GetMapping("0/exportTicket")
|
||||
public void exportTicket0(HttpServletResponse response, @Valid @RequestParam @NotNull Long id) throws Exception {
|
||||
|
|
@ -496,6 +501,7 @@ public class OutProduceController extends BaseController {
|
|||
List<OutProduceInfoItemVO> list = outProduceTicketItemService.getList(id);
|
||||
list.forEach(it -> it.setAufnr(order.getAufnr()));
|
||||
Map<String, String> base = new HashMap<>();
|
||||
base.put("title", order.getDataType() == 0 ? "生产订单发料单" : "成品发货出库单");
|
||||
base.put("createDate", DateUtil.format(order.getCreateTime(), "yyyy-MM-dd"));
|
||||
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
|
|
@ -505,4 +511,30 @@ public class OutProduceController extends BaseController {
|
|||
String html = ThymeleafUtil.generator("/template/", "生产领料出库单", ".html", variables);
|
||||
PdfGeneratorUtil.generatePdf("生产领料出库单" + order.getNo(), html, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出领料出库单EXCEL
|
||||
* @param id 出库单id
|
||||
*/
|
||||
@GetMapping("exportTicket")
|
||||
public void exportTicket(HttpServletResponse response, @RequestParam @NotNull Long id) throws IOException {
|
||||
OutProduceTicketVO order = outProduceTicketService.getInfo(id);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("领料出库单不存在");
|
||||
List<Map<String, Object>> datas = new ArrayList<>();
|
||||
List<OutProduceInfoItemVO> list = outProduceTicketItemService.getList(id);
|
||||
list.forEach(it -> {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("物料编码", it.getMatnr());
|
||||
map.put("物料描述", it.getMaktx2());
|
||||
map.put("单位", it.getMeins());
|
||||
map.put("预留/相关需求的项目编号", it.getRspos());
|
||||
map.put("需求日期", it.getBdter());
|
||||
map.put("申请数量", it.getNum());
|
||||
map.put("工厂", order.getDwerk());
|
||||
map.put("仓库", it.getLgort2());
|
||||
datas.add(map);
|
||||
});
|
||||
EecExcelUtil.eecExcel((order.getDataType() == 0 ? "生产订单发料单" : "成品发货出库单") + order.getTicketNo()
|
||||
, new ListMapSheet<>(datas), response);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@
|
|||
</div>
|
||||
<div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">成品/半成品入库单</div>
|
||||
<div class="title" th:text="${base.title}">成品/半成品入库单</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-desc">
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@
|
|||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||
<div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">生产订单发料单</div>
|
||||
<div class="title" th:text="${base.title}">生产订单发料单</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-desc">
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@
|
|||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||
<div>
|
||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||
<div class="title">生产订单领料单</div>
|
||||
<div class="title" th:text="${base.title}">生产订单领料单</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-desc">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,12 @@ package com.nflg.wms.common.pojo.qo;
|
|||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class InProduceOrderSaveQO extends InProduceOrderGenerateMaterialsQO{
|
||||
public class InProduceOrderSaveQO extends InProduceOrderGenerateMaterialsQO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型,0:半成品;1:成品
|
||||
*/
|
||||
private Integer dataType = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,15 @@ package com.nflg.wms.common.pojo.qo;
|
|||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class InProduceOrderSearchQO extends SearchBaseQO{
|
||||
public class InProduceOrderSearchQO extends SearchBaseQO {
|
||||
|
||||
/**
|
||||
* 报工单号或生产订单号
|
||||
*/
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 类型,0:半成品;1:成品
|
||||
*/
|
||||
private Integer dataType = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ public class OutProduceSearchQO extends SearchBaseQO {
|
|||
@NotNull
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 数据类型,0:半成品;1:成品
|
||||
*/
|
||||
private Integer dataType = 0;
|
||||
|
||||
/**
|
||||
* 领料单号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,4 +11,9 @@ public class OutProduceTicketVO extends OutProduceVO {
|
|||
* 出库单号
|
||||
*/
|
||||
private String ticketNo;
|
||||
|
||||
/**
|
||||
* 数据类型,0:半成品;1:成品
|
||||
*/
|
||||
private Integer dataType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,6 +130,11 @@ public class Zwm3a07VO {
|
|||
*/
|
||||
private BigDecimal leftNum;
|
||||
|
||||
/**
|
||||
* 数据类型,0:半成品;1:成品
|
||||
*/
|
||||
private Integer dataType = 0;
|
||||
|
||||
@JsonIgnore
|
||||
private String key1;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
|
|
@ -51,6 +52,12 @@ public class WmsInProduceOrder implements Serializable {
|
|||
*/
|
||||
private Short state;
|
||||
|
||||
/**
|
||||
* 数据类型,0:半成品;1:成品
|
||||
*/
|
||||
@TableField("data_type")
|
||||
private Integer dataType;
|
||||
|
||||
/**
|
||||
* 物料凭证编号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
|
|
@ -129,4 +130,10 @@ public class WmsOutProduce implements Serializable {
|
|||
* 类型,0:领料;1:补料
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 数据类型,0:半成品;1:成品
|
||||
*/
|
||||
@TableField("data_type")
|
||||
private Integer dataType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ public class WmsInProduceOrderServiceImpl extends ServiceImpl<WmsInProduceOrderM
|
|||
@Override
|
||||
public IPage<WmsInProduceOrder> search(InProduceOrderSearchQO request) {
|
||||
return lambdaQuery()
|
||||
.eq(WmsInProduceOrder::getDataType, request.getDataType())
|
||||
.and(StrUtil.isNotBlank(request.getNo()),wrapper ->
|
||||
wrapper.like(WmsInProduceOrder::getNo, request.getNo())
|
||||
.or()
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
SELECT *
|
||||
FROM wms_out_produce
|
||||
where "type"=#{request.type}
|
||||
<if test="request.dataType!=null and request.type==0">
|
||||
and data_type = #{request.dataType}
|
||||
</if>
|
||||
<if test="request.no!=null and request.no!=''">
|
||||
and "no" ilike concat('%', #{request.no}, '%')
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getInfo" resultType="com.nflg.wms.common.pojo.vo.OutProduceTicketVO">
|
||||
SELECT opt.id,opt."no" as "ticketNo",opt.mat_doc,opt.create_by,opt.create_time,op.*
|
||||
SELECT opt.id,opt."no" as "ticketNo",opt.mat_doc,opt.create_by,opt.create_time,op.data_type,op.*
|
||||
FROM wms_out_produce_ticket opt
|
||||
INNER JOIN wms_out_produce op ON opt.produce_id=op."id"
|
||||
where opt.id=#{id}
|
||||
|
|
|
|||
Loading…
Reference in New Issue