Merge branch 'feature/bug-890' into develop
# Conflicts: # nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/InProduceOrderController.java # nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/qo/OutProduceSearchQO.java # nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/OutProduceTicketVO.java # nflg-wms-repository/src/main/resources/mapper/WmsOutProduceTicketMapper.xml
This commit is contained in:
commit
88717846a8
|
|
@ -111,6 +111,7 @@ public class InProduceOrderController extends BaseController {
|
||||||
public ApiResult<Long> save(@Valid @RequestBody InProduceOrderSaveQO request) {
|
public ApiResult<Long> save(@Valid @RequestBody InProduceOrderSaveQO request) {
|
||||||
if (Objects.isNull(request.getId())) {
|
if (Objects.isNull(request.getId())) {
|
||||||
WmsInProduceOrder order = new WmsInProduceOrder()
|
WmsInProduceOrder order = new WmsInProduceOrder()
|
||||||
|
.setDataType(request.getDataType())
|
||||||
.setNo(serialNumberControllerService.generateSerialNumber(8))
|
.setNo(serialNumberControllerService.generateSerialNumber(8))
|
||||||
.setOrderNo(request.getAufnr())
|
.setOrderNo(request.getAufnr())
|
||||||
.setList(request.getList())
|
.setList(request.getList())
|
||||||
|
|
@ -206,7 +207,7 @@ public class InProduceOrderController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出物料条码pdf(逐个)
|
* 导出物料条码pdf(逐个)
|
||||||
* @param id 订单ID
|
* @param id 订单ID
|
||||||
* @param type 1:逐个,2:一页
|
* @param type 1:逐个,2:一页
|
||||||
*/
|
*/
|
||||||
@GetMapping("exportMaterialsPdf")
|
@GetMapping("exportMaterialsPdf")
|
||||||
|
|
@ -283,6 +284,7 @@ public class InProduceOrderController extends BaseController {
|
||||||
}
|
}
|
||||||
InProduceOrderItemVO first = list.get(0);
|
InProduceOrderItemVO first = list.get(0);
|
||||||
Map<String, String> base = new HashMap<>();
|
Map<String, String> base = new HashMap<>();
|
||||||
|
base.put("title", order.getDataType() == 0 ? "半成品入库单" : "成品入库单");
|
||||||
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
||||||
base.put("factoryNo", first.getFactoryNo());
|
base.put("factoryNo", first.getFactoryNo());
|
||||||
base.put("warehouseNo", first.getWarehouseNo());
|
base.put("warehouseNo", first.getWarehouseNo());
|
||||||
|
|
@ -423,7 +425,7 @@ public class InProduceOrderController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void syncStorage(InProduceOrderItemVO it, Collection<String> binNos) {
|
private void syncStorage(InProduceOrderItemVO it, Collection<String> binNos) {
|
||||||
if(CollectionUtil.isEmpty(binNos))
|
if (CollectionUtil.isEmpty(binNos))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
produceOrderItemService.lambdaUpdate()
|
produceOrderItemService.lambdaUpdate()
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import com.nflg.wms.common.pojo.dto.InventoryForOutDTO;
|
||||||
import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO;
|
||||||
import com.nflg.wms.common.pojo.qo.*;
|
import com.nflg.wms.common.pojo.qo.*;
|
||||||
import com.nflg.wms.common.pojo.vo.*;
|
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.UserUtil;
|
||||||
import com.nflg.wms.common.util.VUtil;
|
import com.nflg.wms.common.util.VUtil;
|
||||||
import com.nflg.wms.repository.entity.WmsOutProduce;
|
import com.nflg.wms.repository.entity.WmsOutProduce;
|
||||||
|
|
@ -42,7 +43,9 @@ import org.redisson.api.RLock;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.ttzero.excel.entity.ListMapSheet;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -500,6 +503,7 @@ public class OutProduceController extends BaseController {
|
||||||
// list.add(new WmsOutProduceItem().setMatnr(RandomUtil.randomNumbers(10)));
|
// list.add(new WmsOutProduceItem().setMatnr(RandomUtil.randomNumbers(10)));
|
||||||
// }
|
// }
|
||||||
Map<String, String> base = new HashMap<>();
|
Map<String, String> base = new HashMap<>();
|
||||||
|
base.put("title", order.getDataType() == 0 ? "生产订单领料单" : "成品发货领料单");
|
||||||
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
||||||
base.put("qrcode", QRCodeUtil.generateQRCodeBase64(order.getNo(), 100, 100));
|
base.put("qrcode", QRCodeUtil.generateQRCodeBase64(order.getNo(), 100, 100));
|
||||||
Map<String, Object> variables = new HashMap<>();
|
Map<String, Object> variables = new HashMap<>();
|
||||||
|
|
@ -559,6 +563,7 @@ public class OutProduceController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出领料出库单
|
* 导出领料出库单
|
||||||
|
* @param id 出库单id
|
||||||
*/
|
*/
|
||||||
@GetMapping("0/exportTicket")
|
@GetMapping("0/exportTicket")
|
||||||
public void exportTicket0(HttpServletResponse response, @Valid @RequestParam @NotNull Long id) throws Exception {
|
public void exportTicket0(HttpServletResponse response, @Valid @RequestParam @NotNull Long id) throws Exception {
|
||||||
|
|
@ -568,6 +573,7 @@ public class OutProduceController extends BaseController {
|
||||||
List<OutProduceInfoItemVO> list = outProduceTicketItemService.getList(id);
|
List<OutProduceInfoItemVO> list = outProduceTicketItemService.getList(id);
|
||||||
list.forEach(it -> it.setAufnr(order.getAufnr()));
|
list.forEach(it -> it.setAufnr(order.getAufnr()));
|
||||||
Map<String, String> base = new HashMap<>();
|
Map<String, String> base = new HashMap<>();
|
||||||
|
base.put("title", order.getDataType() == 0 ? "生产订单发料单" : "成品发货出库单");
|
||||||
base.put("createDate", DateUtil.format(order.getCreateTime(), "yyyy-MM-dd"));
|
base.put("createDate", DateUtil.format(order.getCreateTime(), "yyyy-MM-dd"));
|
||||||
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd"));
|
||||||
Map<String, Object> variables = new HashMap<>();
|
Map<String, Object> variables = new HashMap<>();
|
||||||
|
|
@ -577,4 +583,30 @@ public class OutProduceController extends BaseController {
|
||||||
String html = ThymeleafUtil.generator("/template/", "生产领料出库单", ".html", variables);
|
String html = ThymeleafUtil.generator("/template/", "生产领料出库单", ".html", variables);
|
||||||
PdfGeneratorUtil.generatePdf("生产领料出库单" + order.getNo(), html, response);
|
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>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">成品/半成品入库单</div>
|
<div class="title" th:text="${base.title}">成品/半成品入库单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-desc">
|
<div class="table-desc">
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@
|
||||||
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
<div class="package-logo" style="margin: 5px;position:absolute;"><img src="../img/logo1.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">生产订单发料单</div>
|
<div class="title" th:text="${base.title}">生产订单发料单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-desc">
|
<div class="table-desc">
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@
|
||||||
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
<div class="qrcode"><img th:src="${base.qrcode}" src="../img/qrcode.png"/></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="company-name">福建南方路面机械股份有限公司</div>
|
<div class="company-name">福建南方路面机械股份有限公司</div>
|
||||||
<div class="title">生产订单领料单</div>
|
<div class="title" th:text="${base.title}">生产订单领料单</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-desc">
|
<div class="table-desc">
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,12 @@ package com.nflg.wms.common.pojo.qo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class InProduceOrderSaveQO extends InProduceOrderGenerateMaterialsQO{
|
public class InProduceOrderSaveQO extends InProduceOrderGenerateMaterialsQO {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型,0:半成品;1:成品
|
||||||
|
*/
|
||||||
|
private Integer dataType = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,15 @@ package com.nflg.wms.common.pojo.qo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class InProduceOrderSearchQO extends SearchBaseQO{
|
public class InProduceOrderSearchQO extends SearchBaseQO {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报工单号或生产订单号
|
* 报工单号或生产订单号
|
||||||
*/
|
*/
|
||||||
private String no;
|
private String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型,0:半成品;1:成品
|
||||||
|
*/
|
||||||
|
private Integer dataType = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,24 @@
|
||||||
package com.nflg.wms.common.pojo.qo;
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class OutProduceSearchQO extends SearchBaseQO {
|
public class OutProduceSearchQO extends SearchBaseQO {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单号
|
* 类型,0:领料;1:补料
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型,0:半成品;1:成品
|
||||||
|
*/
|
||||||
|
private Integer dataType = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料单号
|
||||||
*/
|
*/
|
||||||
private String no;
|
private String no;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ public class OutProduceTicketVO extends OutProduceVO {
|
||||||
*/
|
*/
|
||||||
private String ticketNo;
|
private String ticketNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型,0:半成品;1:成品
|
||||||
|
*/
|
||||||
|
private Integer dataType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否已完成
|
* 是否已完成
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,11 @@ public class Zwm3a07VO {
|
||||||
*/
|
*/
|
||||||
private BigDecimal leftNum;
|
private BigDecimal leftNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型,0:半成品;1:成品
|
||||||
|
*/
|
||||||
|
private Integer dataType = 0;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private String key1;
|
private String key1;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.wms.repository.entity;
|
package com.nflg.wms.repository.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
@ -51,6 +52,12 @@ public class WmsInProduceOrder implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Short state;
|
private Short state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型,0:半成品;1:成品
|
||||||
|
*/
|
||||||
|
@TableField("data_type")
|
||||||
|
private Integer dataType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料凭证编号
|
* 物料凭证编号
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.wms.repository.entity;
|
package com.nflg.wms.repository.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
@ -129,4 +130,10 @@ public class WmsOutProduce implements Serializable {
|
||||||
* 类型,0:领料;1:补料
|
* 类型,0:领料;1:补料
|
||||||
*/
|
*/
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型,0:半成品;1:成品
|
||||||
|
*/
|
||||||
|
@TableField("data_type")
|
||||||
|
private Integer dataType;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ public class WmsInProduceOrderServiceImpl extends ServiceImpl<WmsInProduceOrderM
|
||||||
@Override
|
@Override
|
||||||
public IPage<WmsInProduceOrder> search(InProduceOrderSearchQO request) {
|
public IPage<WmsInProduceOrder> search(InProduceOrderSearchQO request) {
|
||||||
return lambdaQuery()
|
return lambdaQuery()
|
||||||
|
.eq(WmsInProduceOrder::getDataType, request.getDataType())
|
||||||
.and(StrUtil.isNotBlank(request.getNo()),wrapper ->
|
.and(StrUtil.isNotBlank(request.getNo()),wrapper ->
|
||||||
wrapper.like(WmsInProduceOrder::getNo, request.getNo())
|
wrapper.like(WmsInProduceOrder::getNo, request.getNo())
|
||||||
.or()
|
.or()
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM wms_out_produce
|
FROM wms_out_produce
|
||||||
where "type"=#{request.type}
|
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!=''">
|
<if test="request.no!=null and request.no!=''">
|
||||||
and "no" ilike concat('%', #{request.no}, '%')
|
and "no" ilike concat('%', #{request.no}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getInfo" resultType="com.nflg.wms.common.pojo.vo.OutProduceTicketVO">
|
<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,opt.finish,op.*
|
SELECT opt.id,opt."no" as "ticketNo",opt.mat_doc,opt.create_by,opt.create_time,opt.finish,op.data_type,op.*
|
||||||
FROM wms_out_produce_ticket opt
|
FROM wms_out_produce_ticket opt
|
||||||
INNER JOIN wms_out_produce op ON opt.produce_id=op."id"
|
INNER JOIN wms_out_produce op ON opt.produce_id=op."id"
|
||||||
where opt.id=#{id}
|
where opt.id=#{id}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue