修改飞书问题276行的问题集合

jg-waiwang-pro
CJYXTX\27961 7 months ago
parent 587b74a8a2
commit 2bd9abe192

@ -14,6 +14,7 @@
<result column="box_surface_num" property="boxSurfaceNum"/>
<result column="spec" property="spec"/>
<result column="inventory_type" property="inventoryType"/>
<result column="inventory_unit_id" property="inventoryUnitId"/>
<result column="bar_code" property="barCode"/>
<result column="f_creator_time" property="creatorTime"/>
@ -30,6 +31,9 @@
<result column="salesOrderQuantityDowns" property="salesOrderQuantityDowns"/>
<result column="salesOrderQuantityUppers" property="salesOrderQuantityUppers"/>
<result column="salesOrderMultiples" property="salesOrderMultiples"/>
<result column="productTypeIds" property="productTypeIds"/>
<result column="inventoryTypes" property="inventoryTypes"/>
</resultMap>
<select id="getProductWarehouseList" resultMap="getProductWarehouseMap">
@ -43,7 +47,7 @@
'半成品'
WHEN 3 THEN
'产成品'
END AS inventory_types,
END AS inventoryTypes,
CASE
product_type_id
WHEN 1 THEN
@ -54,12 +58,14 @@
'设备/器材'
WHEN 4 THEN
'耗材/辅材'
END AS product_type_ids,
END AS productTypeIds,
IF
(
many_unit_flag = 1,
JgFnUnitName ( order_main_unit_id ),
JgFnUnitArrName ( order_main_unit_id )) AS orderMainUnitIds,
order_main_unit_id AS orderMainUnitId,
purchase_order_quantity_down as purchaseOrderQuantityDowns,
purchase_order_quantity_upper as purchaseOrderQuantityUppers,
purchase_order_multiple as purchaseOrderMultiples,
@ -72,7 +78,9 @@
sales_order_quantity_upper as salesOrderQuantityUppers,
sales_order_multiple as salesOrderMultiples,
JgFnUnitName ( inventory_unit_id ) AS inventoryUnitIds,
JgFnUnitName ( operate_unit_id ) AS operateUnitIds
JgFnUnitName ( operate_unit_id ) AS operateUnitIds,
operate_unit_id AS operateUnitId
FROM
jg_product a
LEFT JOIN flow_task b ON a.id = b.f_process_id

@ -18,6 +18,7 @@
<result column="barCode" property="barCode"></result>
<result column="inventoryType" property="inventoryType"></result>
<result column="inventoryUnitIds" property="inventoryUnitIds"></result>
<result column="theoryNum" property="theoryNum"></result>
</resultMap>
@ -41,13 +42,13 @@
<select id="queryworkOrderBomProduct" resultMap="workOrderBomProduct">
SELECT
a.id,
a.id AS productId,
a.name AS name,
a.spec,
a.bar_code AS barCode,
b.id,
b.id AS productId,
b.NAME AS NAME,
b.spec,
b.bar_code AS barCode,
CASE
a.inventory_type
b.inventory_type
WHEN 1 THEN
'原材料'
WHEN 2 THEN
@ -55,12 +56,17 @@
WHEN 3 THEN
'产成品'
END AS inventoryType,
JgFnUnitName ( a.inventory_unit_id ) AS inventoryUnitIds
JgFnUnitName ( b.inventory_unit_id ) AS inventoryUnitIds,
a.proportion_num AS theoryNum
FROM
jg_product a
jg_bom_item_value a
LEFT JOIN jg_product b ON a.product_id = b.id
AND b.f_delete_mark
IS NULL LEFT JOIN jg_bom c ON a.bom_id = c.id
AND c.f_delete_mark IS NULL
WHERE
a.f_delete_mark IS NULL
AND a.id = #{id}
AND c.id = #{id}
</select>
</mapper>

@ -39,6 +39,9 @@ public interface WarehousingOutboundService extends IService<WarehousingOutbound
String checkForm(WarehousingOutboundForm form,int i);
void saveOrUpdate(WarehousingOutboundForm warehousingOutboundForm,String id, boolean isSave) throws Exception;
//加工单创建出库
void saveOrUpdateWork(WarehousingOutboundForm warehousingOutboundForm,String id, boolean isSave) throws Exception;
//查询实际出库数量
String queryOutboundNumber(String id);

@ -35,6 +35,9 @@ public interface WarehousingReportlossService extends IService<WarehousingReport
String checkForm(WarehousingReportlossForm form,int i);
void saveOrUpdate(WarehousingReportlossForm warehousingReportlossForm,String id, boolean isSave) throws Exception;
//加工单报损
void saveOrUpdateWork(WarehousingReportlossForm warehousingReportlossForm,String id, boolean isSave) throws Exception;
//查询报损总数量
String queryReportlossSum(String id);

@ -35,6 +35,9 @@ public interface WarehousingReturnService extends IService<WarehousingReturnEnti
String checkForm(WarehousingReturnForm form,int i);
void saveOrUpdate(WarehousingReturnForm warehousingReturnForm,String id, boolean isSave) throws Exception;
//加工单添加返库单
void saveOrUpdateWork(WarehousingReturnForm warehousingReturnForm,String id, boolean isSave) throws Exception;
//返库总数量
String queryReturnNum(String id);

@ -39,6 +39,9 @@ public interface WarehousingStorageService extends IService<WarehousingStorageEn
String checkForm(WarehousingStorageForm form,int i);
void saveOrUpdate(WarehousingStorageForm warehousingStorageForm,String id, boolean isSave) throws Exception;
//加工单入库
void saveOrUpdateWork(WarehousingStorageForm warehousingStorageForm,String id, boolean isSave) throws Exception;
//查询实际入库数量
String queryRealityNumber(String id);

@ -39,6 +39,8 @@ public interface WorkOrderService extends IService<WorkOrderEntity> {
String checkForm(WorkOrderForm form,int i);
void saveOrUpdate(WorkOrderForm workOrderForm,String id, boolean isSave) throws Exception;
void saveOrUpdateWork(WorkOrderForm workOrderForm,String id, boolean isSave) throws Exception;
//加工单根据商品成品查询bom带出原材料
List<BomEntity> getWorkBom(String id);

@ -540,6 +540,81 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
}
}
/**
* ()
* @param id
* @param warehousingOutboundForm
* @return
*/
@Override
@Transactional
public void saveOrUpdateWork(WarehousingOutboundForm warehousingOutboundForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingOutboundForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingOutboundConstant.getFormData(),warehousingOutboundForm),WarehousingOutboundForm.class);
WarehousingOutboundEntity entity = JsonUtil.getJsonToBean(warehousingOutboundForm, WarehousingOutboundEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setDocumentNo(generaterSwapUtil.getBillNumber("chukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setId(mainId);
entity.setFlowId(warehousingOutboundForm.getFlowId());
entity.setVersion(0);
}else{
entity.setDocumentNo(generaterSwapUtil.getBillNumber("chukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setFlowId(warehousingOutboundForm.getFlowId());
}
this.saveOrUpdate(entity);
//WarehousingOutboundPoundlist子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingOutboundPoundlistEntity> WarehousingOutboundPoundlistqueryWrapper = new QueryWrapper<>();
WarehousingOutboundPoundlistqueryWrapper.lambda().eq(WarehousingOutboundPoundlistEntity::getWarehousingOutboundId, entity.getId());
warehousingOutboundPoundlistService.remove(WarehousingOutboundPoundlistqueryWrapper);
}
if (warehousingOutboundForm.getWarehousingOutboundPoundlistList()!=null){
List<WarehousingOutboundPoundlistEntity> tableField114 = JsonUtil.getJsonToList(warehousingOutboundForm.getWarehousingOutboundPoundlistList(),WarehousingOutboundPoundlistEntity.class);
for(WarehousingOutboundPoundlistEntity entitys : tableField114){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingOutboundId(entity.getId());
if(isSave){
}else{
}
warehousingOutboundPoundlistService.saveOrUpdate(entitys);
}
}
//WarehousingOutboundProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingOutboundProductEntity> WarehousingOutboundProductqueryWrapper = new QueryWrapper<>();
WarehousingOutboundProductqueryWrapper.lambda().eq(WarehousingOutboundProductEntity::getWarehousingOutboundId, entity.getId());
warehousingOutboundProductService.remove(WarehousingOutboundProductqueryWrapper);
}
if (warehousingOutboundForm.getWarehousingOutboundProductList()!=null){
List<WarehousingOutboundProductEntity> tableField119 = JsonUtil.getJsonToList(warehousingOutboundForm.getWarehousingOutboundProductList(),WarehousingOutboundProductEntity.class);
for(WarehousingOutboundProductEntity entitys : tableField119){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingOutboundId(entity.getId());
if(isSave){
}else{
}
warehousingOutboundProductService.saveOrUpdate(entitys);
}
}
}
@Override
public String queryOutboundNumber(String id) {
return warehousingOutboundMapper.queryOutboundNumber(id);

@ -407,6 +407,56 @@ public class WarehousingReportlossServiceImpl extends ServiceImpl<WarehousingRep
}
}
/**
* ()
* @param id
* @param warehousingReportlossForm
* @return
*/
@Override
@Transactional
public void saveOrUpdateWork(WarehousingReportlossForm warehousingReportlossForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingReportlossForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingReportlossConstant.getFormData(),warehousingReportlossForm),WarehousingReportlossForm.class);
WarehousingReportlossEntity entity = JsonUtil.getJsonToBean(warehousingReportlossForm, WarehousingReportlossEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setReportlossCode(generaterSwapUtil.getBillNumber("warehousingReportloss", false));
entity.setId(mainId);
entity.setFlowId(warehousingReportlossForm.getFlowId());
entity.setVersion(0);
entity.setReportlossTime(new Date());
}else{
entity.setReportlossCode(generaterSwapUtil.getBillNumber("warehousingReportloss", false));
entity.setFlowId(warehousingReportlossForm.getFlowId());
entity.setReportlossTime(new Date());
}
this.saveOrUpdate(entity);
//WarehousingReportlossProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingReportlossProductEntity> WarehousingReportlossProductqueryWrapper = new QueryWrapper<>();
WarehousingReportlossProductqueryWrapper.lambda().eq(WarehousingReportlossProductEntity::getReportlossId, entity.getId());
warehousingReportlossProductService.remove(WarehousingReportlossProductqueryWrapper);
}
if (warehousingReportlossForm.getWarehousingReportlossProductList()!=null){
List<WarehousingReportlossProductEntity> tableField109 = JsonUtil.getJsonToList(warehousingReportlossForm.getWarehousingReportlossProductList(),WarehousingReportlossProductEntity.class);
for(WarehousingReportlossProductEntity entitys : tableField109){
entitys.setId(RandomUtil.uuId());
entitys.setReportlossId(entity.getId());
if(isSave){
}else{
}
warehousingReportlossProductService.saveOrUpdate(entitys);
}
}
}
@Override
public String queryReportlossSum(String id) {
return warehousingReportlossMapper.queryReportlossSum(id);

@ -435,6 +435,63 @@ public class WarehousingReturnServiceImpl extends ServiceImpl<WarehousingReturnM
}
}
/**
* ()
* @param id
* @param warehousingReturnForm
* @return
*/
@Override
@Transactional
public void saveOrUpdateWork(WarehousingReturnForm warehousingReturnForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingReturnForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingReturnConstant.getFormData(),warehousingReturnForm),WarehousingReturnForm.class);
WarehousingReturnEntity entity = JsonUtil.getJsonToBean(warehousingReturnForm, WarehousingReturnEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setReturnCode(generaterSwapUtil.getBillNumber("warehousingReturn", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setId(mainId);
entity.setFlowId(warehousingReturnForm.getFlowId());
entity.setVersion(0);
entity.setReturnTime(new Date());
}else{
entity.setReturnCode(generaterSwapUtil.getBillNumber("warehousingReturn", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setFlowId(warehousingReturnForm.getFlowId());
entity.setReturnTime(new Date());
}
this.saveOrUpdate(entity);
//WarehousingReturnProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingReturnProductEntity> WarehousingReturnProductqueryWrapper = new QueryWrapper<>();
WarehousingReturnProductqueryWrapper.lambda().eq(WarehousingReturnProductEntity::getReturnId, entity.getId());
warehousingReturnProductService.remove(WarehousingReturnProductqueryWrapper);
}
if (warehousingReturnForm.getWarehousingReturnProductList()!=null){
List<WarehousingReturnProductEntity> tableField116 = JsonUtil.getJsonToList(warehousingReturnForm.getWarehousingReturnProductList(),WarehousingReturnProductEntity.class);
for(WarehousingReturnProductEntity entitys : tableField116){
entitys.setId(RandomUtil.uuId());
entitys.setReturnId(entity.getId());
if(isSave){
}else{
}
warehousingReturnProductService.saveOrUpdate(entitys);
}
}
}
@Override
public String queryReturnNum(String id) {
return warehousingReturnMapper.queryReturnNum(id);

@ -540,6 +540,80 @@ public class WarehousingStorageServiceImpl extends ServiceImpl<WarehousingStorag
}
}
/**
* ()
* @param id
* @param warehousingStorageForm
* @return
*/
@Override
@Transactional
public void saveOrUpdateWork(WarehousingStorageForm warehousingStorageForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
warehousingStorageForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WarehousingStorageConstant.getFormData(),warehousingStorageForm),WarehousingStorageForm.class);
WarehousingStorageEntity entity = JsonUtil.getJsonToBean(warehousingStorageForm, WarehousingStorageEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setDocumentNo(generaterSwapUtil.getBillNumber("rukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setId(mainId);
entity.setFlowId(warehousingStorageForm.getFlowId());
entity.setVersion(0);
}else{
entity.setDocumentNo(generaterSwapUtil.getBillNumber("rukudanbianhao", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyTime(null);
entity.setLastModifyUserId(null);
entity.setFlowId(warehousingStorageForm.getFlowId());
}
this.saveOrUpdate(entity);
//WarehousingStoragePoundlist子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingStoragePoundlistEntity> WarehousingStoragePoundlistqueryWrapper = new QueryWrapper<>();
WarehousingStoragePoundlistqueryWrapper.lambda().eq(WarehousingStoragePoundlistEntity::getWarehousingStorageId, entity.getId());
warehousingStoragePoundlistService.remove(WarehousingStoragePoundlistqueryWrapper);
}
if (warehousingStorageForm.getWarehousingStoragePoundlistList()!=null){
List<WarehousingStoragePoundlistEntity> tableField114 = JsonUtil.getJsonToList(warehousingStorageForm.getWarehousingStoragePoundlistList(),WarehousingStoragePoundlistEntity.class);
for(WarehousingStoragePoundlistEntity entitys : tableField114){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingStorageId(entity.getId());
if(isSave){
}else{
}
warehousingStoragePoundlistService.saveOrUpdate(entitys);
}
}
//WarehousingStorageProduct子表数据新增修改
if(!isSave){
QueryWrapper<WarehousingStorageProductEntity> WarehousingStorageProductqueryWrapper = new QueryWrapper<>();
WarehousingStorageProductqueryWrapper.lambda().eq(WarehousingStorageProductEntity::getWarehousingStorageId, entity.getId());
warehousingStorageProductService.remove(WarehousingStorageProductqueryWrapper);
}
if (warehousingStorageForm.getWarehousingStorageProductList()!=null){
List<WarehousingStorageProductEntity> tableField119 = JsonUtil.getJsonToList(warehousingStorageForm.getWarehousingStorageProductList(),WarehousingStorageProductEntity.class);
for(WarehousingStorageProductEntity entitys : tableField119){
entitys.setId(RandomUtil.uuId());
entitys.setWarehousingStorageId(entity.getId());
if(isSave){
entitys.setBatchNumber(generaterSwapUtil.getBillNumber("picihao", false));
}else{
entitys.setBatchNumber(generaterSwapUtil.getBillNumber("picihao", false));
}
warehousingStorageProductService.saveOrUpdate(entitys);
}
}
}
@Override
public String queryRealityNumber(String id) {
return warehousingStorageMapper.queryrealityNumber(id);

@ -445,11 +445,64 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
entity.setCode(generaterSwapUtil.getBillNumber("workOrder", false));
entity.setFlowId(workOrderForm.getFlowId());
}
// if (entity.getType().equals("1")){
// entity.setStatus("4");
// }else if (entity.getType().equals("2")){
// entity.setStatus("2");
// }
this.saveOrUpdate(entity);
//WorkOrderProduct子表数据新增修改
if(!isSave){
QueryWrapper<WorkOrderProductEntity> WorkOrderProductqueryWrapper = new QueryWrapper<>();
WorkOrderProductqueryWrapper.lambda().eq(WorkOrderProductEntity::getWorkId, entity.getId());
workOrderProductService.remove(WorkOrderProductqueryWrapper);
}
if (workOrderForm.getWorkOrderProductList()!=null){
List<WorkOrderProductEntity> tableField116 = JsonUtil.getJsonToList(workOrderForm.getWorkOrderProductList(),WorkOrderProductEntity.class);
for(WorkOrderProductEntity entitys : tableField116){
entitys.setId(RandomUtil.uuId());
entitys.setWorkId(entity.getId());
if(isSave){
}else{
}
workOrderProductService.saveOrUpdate(entitys);
}
}
//WorkOrderPrimary子表数据新增修改
if(!isSave){
QueryWrapper<WorkOrderPrimaryEntity> WorkOrderPrimaryqueryWrapper = new QueryWrapper<>();
WorkOrderPrimaryqueryWrapper.lambda().eq(WorkOrderPrimaryEntity::getWorkId, entity.getId());
workOrderPrimaryService.remove(WorkOrderPrimaryqueryWrapper);
}
if (workOrderForm.getWorkOrderPrimaryList()!=null){
List<WorkOrderPrimaryEntity> tableField126 = JsonUtil.getJsonToList(workOrderForm.getWorkOrderPrimaryList(),WorkOrderPrimaryEntity.class);
for(WorkOrderPrimaryEntity entitys : tableField126){
entitys.setId(RandomUtil.uuId());
entitys.setWorkId(entity.getId());
if(isSave){
}else{
}
workOrderPrimaryService.saveOrUpdate(entitys);
}
}
}
@Override
public void saveOrUpdateWork(WorkOrderForm workOrderForm, String id, boolean isSave) throws Exception {
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
workOrderForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(WorkOrderConstant.getFormData(),workOrderForm),WorkOrderForm.class);
WorkOrderEntity entity = JsonUtil.getJsonToBean(workOrderForm, WorkOrderEntity.class);
if(isSave){
// String mainId = id ;
// entity.setCode(generaterSwapUtil.getBillNumber("workOrder", false));
// entity.setId(mainId);
// entity.setFlowId(workOrderForm.getFlowId());
// entity.setVersion(0);
}else{
// entity.setCode(generaterSwapUtil.getBillNumber("workOrder", false));
// entity.setFlowId(workOrderForm.getFlowId());
}
this.saveOrUpdate(entity);
//WorkOrderProduct子表数据新增修改

@ -143,7 +143,7 @@ public class ProductWarehouseController {
realList.add(productWarehouseMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ProductWarehouseConstant.getFormData(), ProductWarehouseConstant.getColumnData(), productWarehousePagination.getModuleId(),false);
// realList = generaterSwapUtil.swapDataList(realList, ProductWarehouseConstant.getFormData(), ProductWarehouseConstant.getColumnData(), productWarehousePagination.getModuleId(),false);
//流程状态添加
// for(Map<String, Object> vo:realList){
// FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);

@ -167,6 +167,28 @@ public class WarehousingOutboundController {
}
return ActionResult.success("创建成功");
}
/**
* work
*
* @param warehousingOutboundForm
* @return
*/
@PostMapping("/{idWork}")
@Operation(summary = "创建")
public ActionResult createWork(@PathVariable("id") String id, @RequestBody @Valid WarehousingOutboundForm warehousingOutboundForm) {
// String b = warehousingOutboundService.checkForm(warehousingOutboundForm,0);
// if (StringUtil.isNotEmpty(b)){
// return ActionResult.fail(b );
// }
try{
warehousingOutboundService.saveOrUpdateWork(warehousingOutboundForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*

@ -149,6 +149,28 @@ public class WarehousingReportlossController {
}
return ActionResult.success("创建成功");
}
/**
*
*
* @param warehousingReportlossForm
* @return
*/
@PostMapping("/{idWork}")
@Operation(summary = "创建")
public ActionResult createWork(@PathVariable("id") String id, @RequestBody @Valid WarehousingReportlossForm warehousingReportlossForm) {
// String b = warehousingReportlossService.checkForm(warehousingReportlossForm,0);
// if (StringUtil.isNotEmpty(b)){
// return ActionResult.fail(b );
// }
try{
warehousingReportlossService.saveOrUpdateWork(warehousingReportlossForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*

@ -149,6 +149,29 @@ public class WarehousingReturnController {
}
return ActionResult.success("创建成功");
}
/**
*
*
* @param warehousingReturnForm
* @return
*/
@PostMapping("/{idWork}")
@Operation(summary = "创建")
public ActionResult createWork(@PathVariable("id") String id, @RequestBody @Valid WarehousingReturnForm warehousingReturnForm) {
// String b = warehousingReturnService.checkForm(warehousingReturnForm,0);
// if (StringUtil.isNotEmpty(b)){
// return ActionResult.fail(b );
// }
try{
warehousingReturnService.saveOrUpdateWork(warehousingReturnForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*

@ -166,6 +166,28 @@ public class WarehousingStorageController {
}
return ActionResult.success("创建成功");
}
/**
* work
*
* @param warehousingStorageForm
* @return
*/
@PostMapping("/{idWork}")
@Operation(summary = "创建")
public ActionResult createWork(@PathVariable("id") String id, @RequestBody @Valid WarehousingStorageForm warehousingStorageForm) {
// String b = warehousingStorageService.checkForm(warehousingStorageForm,0);
// if (StringUtil.isNotEmpty(b)){
// return ActionResult.fail(b );
// }
try{
warehousingStorageService.saveOrUpdateWork(warehousingStorageForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*

@ -16,6 +16,10 @@ import jnpf.model.warehousingoutbound.WarehousingOutboundForm;
import jnpf.model.warehousingoutbound.WarehousingOutboundProductModel;
import jnpf.model.warehousingreceive.WarehousingReceiveForm;
import jnpf.model.warehousingreceive.WarehousingReceiveProductModel;
import jnpf.model.warehousingreportloss.WarehousingReportlossForm;
import jnpf.model.warehousingreportloss.WarehousingReportlossProductModel;
import jnpf.model.warehousingreturn.WarehousingReturnForm;
import jnpf.model.warehousingreturn.WarehousingReturnProductModel;
import jnpf.model.warehousingstorage.WarehousingStorageForm;
import jnpf.model.warehousingstorage.WarehousingStoragePoundlistModel;
import jnpf.model.warehousingstorage.WarehousingStorageProductModel;
@ -30,6 +34,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
@ -94,6 +99,10 @@ public class WorkOrderController {
@Autowired WarehousingReceiveController warehousingReceiveController;
@Autowired
private WarehousingOutboundController warehousingOutboundController;
@Autowired
private WarehousingReturnController warehousingReturnController;
@Autowired
private WarehousingReportlossController warehousingReportlossController;
@Autowired
@ -419,7 +428,7 @@ public class WorkOrderController {
if(flowTaskNodeEntityList != null && "end".equals(flowTaskNodeEntityList.get(0).getNodeNext())){
//审核通过
if (workOrderForm.getType().equals("1")){
workOrderForm.setStatus("4");
workOrderForm.setStatus("5");
} else if (workOrderForm.getType().equals("2")){
workOrderForm.setStatus("2");
}
@ -443,8 +452,8 @@ public class WorkOrderController {
warehousingStorageForm.setWarehousingStorageProductList(list);
}
warehousingStorageController.create(id,warehousingStorageForm);
//原材料生成领用单和出库单
warehousingStorageController.createWork(id,warehousingStorageForm);
//原材料生成领用单和出库单和返库单和报损单
//领用单
WarehousingReceiveForm warehousingReceiveForm=new WarehousingReceiveForm();
warehousingReceiveForm.setWarehouseId(workOrderForm.getWarehouseId()); //仓库
@ -472,11 +481,9 @@ public class WorkOrderController {
receiveWrapper.lambda().eq(WarehousingReceiveEntity::getBusinessId, id);
// flowTaskNodeEntityQueryWrapper.lambda().eq(WarehousingReceiveEntity::getTaskId, flowTaskEntity.getId());
List<WarehousingReceiveEntity> warehousingReceiveEntityList = warehousingReceiveService.list(receiveWrapper);
warehousingOutboundForm.setWarehousingOutboundType("14");
warehousingOutboundForm.setWarehousingId(warehousingReceiveEntityList.get(0).getId());
warehousingOutboundForm.setWarehouseId(warehousingReceiveForm.getWarehouseId());
List<WarehousingOutboundProductModel> warehousingOutboundProductModelList =new ArrayList<>();
for (WarehousingReceiveProductModel warehousingReceiveProductModel1:warehousingReceiveList){
WarehousingOutboundProductModel warehousingOutboundProductModel=new WarehousingOutboundProductModel();
@ -485,11 +492,61 @@ public class WorkOrderController {
warehousingOutboundProductModel.setOutboundUnit(unit); //加工单位
warehousingOutboundProductModel.setOutboundNumber(warehousingReceiveProductModel1.getUsedreturnNumber()); //实际发货量
warehousingOutboundProductModelList.add(warehousingOutboundProductModel);
warehousingOutboundForm.setWarehousingOutboundProductList(warehousingOutboundProductModelList);
}
warehousingOutboundController.create(id,warehousingOutboundForm);
warehousingOutboundController.createWork(id,warehousingOutboundForm);
//返库单
WarehousingReturnForm warehousingReturnForm=new WarehousingReturnForm();
warehousingReturnForm.setBusinessId(workOrderForm.getId());
warehousingReturnForm.setWarehouseId(workOrderForm.getWarehouseId());
warehousingReturnForm.setReturnReason("8");
warehousingReturnForm.setRemark(workOrderForm.getRemark());
BigDecimal retNum = new BigDecimal("0");
BigDecimal zero = BigDecimal.ZERO;
List<WarehousingReturnProductModel> warehousingReturnProductModelList =new ArrayList<>();
for (WorkOrderPrimaryModel WorkOrderPrimaryModel:workOrderForm.getWorkOrderPrimaryList()){
if (WorkOrderPrimaryModel.getReturnNum()==null||WorkOrderPrimaryModel.getReturnNum().equals("0")){
}else{
WarehousingReturnProductModel warehousingReturnProductModel=new WarehousingReturnProductModel();
warehousingReturnProductModel.setProductId(WorkOrderPrimaryModel.getProductId());
warehousingReturnProductModel.setReturnUnit(unit);
warehousingReturnProductModel.setCargoId(WorkOrderPrimaryModel.getCargoId());
warehousingReturnProductModel.setReturnNumber(WorkOrderPrimaryModel.getReturnNum());
warehousingReturnProductModelList.add(warehousingReturnProductModel);
warehousingReturnForm.setWarehousingReturnProductList(warehousingReturnProductModelList);
retNum =new BigDecimal(WorkOrderPrimaryModel.getReturnNum());
}
}
if (retNum.compareTo(zero)>0){
warehousingReturnController.createWork(id,warehousingReturnForm);
}
//报损单
WarehousingReportlossForm warehousingReportlossForm=new WarehousingReportlossForm();
warehousingReportlossForm.setReportlossType("4");
warehousingReportlossForm.setReportlossReason("5");
warehousingReportlossForm.setWarehouseId(workOrderForm.getWarehouseId());
warehousingReportlossForm.setBusinessId(workOrderForm.getId());
warehousingReportlossForm.setRemark(workOrderForm.getRemark());
BigDecimal retNum1 = new BigDecimal("0");
BigDecimal zero1 = BigDecimal.ZERO;
List<WarehousingReportlossProductModel> warehousingReportlossProductModelList =new ArrayList<>();
for (WorkOrderPrimaryModel WorkOrderPrimaryModel:workOrderForm.getWorkOrderPrimaryList()){
if (WorkOrderPrimaryModel.getReportlossNum()==null||WorkOrderPrimaryModel.getReportlossNum().equals("0")){
}else{
WarehousingReportlossProductModel warehousingReportlossProductModel=new WarehousingReportlossProductModel();
warehousingReportlossProductModel.setProductId(WorkOrderPrimaryModel.getProductId());
warehousingReportlossProductModel.setReportlossUnit(unit);
warehousingReportlossProductModel.setCargoId(WorkOrderPrimaryModel.getCargoId());
warehousingReportlossProductModel.setReportlossNumber(WorkOrderPrimaryModel.getReportlossNum());
warehousingReportlossProductModelList.add(warehousingReportlossProductModel);
warehousingReportlossForm.setWarehousingReportlossProductList(warehousingReportlossProductModelList);
retNum1 =new BigDecimal(WorkOrderPrimaryModel.getReportlossNum());
}
}
if (retNum1.compareTo(zero1)>0){
warehousingReportlossController.createWork(id,warehousingReportlossForm);
}
}
}
}
@ -576,6 +633,44 @@ public class WorkOrderController {
return ActionResult.success(workOrderMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/work/{id}")
public ActionResult infoWork(@PathVariable("id") String id){
WorkOrderEntity entity= workOrderService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> workOrderMap=JsonUtil.entityToMap(entity);
workOrderMap.put("id", workOrderMap.get("id"));
//副表数据
//子表数据
List<WorkOrderProductEntity> workOrderProductList = workOrderService.getWorkOrderProductList(entity.getId());
// List<WorkOrderProductEntity> workOrderProductEntityList =new ArrayList<>();
for (WorkOrderProductEntity workOrderProductEntity:workOrderProductList){
workOrderProductEntity.setNums(workOrderProductEntity.getProportionNum());
workOrderProductEntity.setProportionNum(null);
// workOrderProductEntityList.add(workOrderProductEntity);
}
workOrderMap.put("workOrderProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(workOrderProductList)));
List<WorkOrderPrimaryEntity> workOrderPrimaryList = workOrderService.getWorkOrderPrimaryList(entity.getId());
for (WorkOrderPrimaryEntity workOrderPrimaryEntity:workOrderPrimaryList){
workOrderPrimaryEntity.setReturnNum(null);
workOrderPrimaryEntity.setReportlossNum(null);
workOrderPrimaryEntity.setRealityNum(null);
}
workOrderMap.put("workOrderPrimaryList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(workOrderPrimaryList)));
workOrderMap = generaterSwapUtil.swapDataForm(workOrderMap,WorkOrderConstant.getFormData(),WorkOrderConstant.TABLEFIELDKEY,WorkOrderConstant.TABLERENAMES);
return ActionResult.success(workOrderMap);
}
/**
*
* @param id
@ -611,21 +706,197 @@ public class WorkOrderController {
List<BomEntity> workBomlist= workOrderService.getWorkBom(id);
for (BomEntity bomEntity:workBomlist){
QueryWrapper<BomItemValueEntity> bomEntityQueryWrapper = new QueryWrapper<>();
bomEntityQueryWrapper.lambda().eq(BomItemValueEntity::getBomId,bomEntity.getId());
List<BomItemValueEntity> bomItemValueEntityList = bomItemValueService.list(bomEntityQueryWrapper);
bomEntity.setBomItemValueEntityList(bomItemValueEntityList);
List<ProductWarehouseEntity> productList =new ArrayList<>();
for (BomItemValueEntity bomItemValueEntity : bomItemValueEntityList){
List<ProductWarehouseEntity> productWarehouseEntityList=workOrderService.getWorkBomProduct(bomItemValueEntity.getProductId());
productList.addAll(productWarehouseEntityList);
}
bomEntity.setProductWarehouseEntityList(productList);
// QueryWrapper<BomItemValueEntity> bomEntityQueryWrapper = new QueryWrapper<>();
// bomEntityQueryWrapper.lambda().eq(BomItemValueEntity::getBomId,bomEntity.getId());
// List<BomItemValueEntity> bomItemValueEntityList = bomItemValueService.list(bomEntityQueryWrapper);
// bomEntity.setBomItemValueEntityList(bomItemValueEntityList);
// List<ProductWarehouseEntity> productList =new ArrayList<>();
// for (BomItemValueEntity bomItemValueEntity : bomItemValueEntityList){
// List<ProductWarehouseEntity> productWarehouseEntityList=workOrderService.getWorkBomProduct(bomItemValueEntity.getProductId());
List<ProductWarehouseEntity> productWarehouseEntityList=workOrderService.getWorkBomProduct(bomEntity.getId());
// productList.addAll(productWarehouseEntityList);
// }
// bomEntity.setProductWarehouseEntityList(productList);
bomEntity.setProductWarehouseEntityList(productWarehouseEntityList);
}
return ActionResult.success(workBomlist);
}
/**
*
* @param id
* @param workOrderForm
* @return
*/
@PutMapping("/workStatus/{id}")
@Operation(summary = "编辑状态")
public ActionResult updateWorkStatus(@PathVariable("id") String id,@RequestBody @Valid WorkOrderForm workOrderForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
workOrderForm.setId(id);
WorkOrderEntity entity= workOrderService.getInfo(id);
if(entity!=null){
try{
BigDecimal bigworknums;
BigDecimal retNums;
BigDecimal zeros = BigDecimal.ZERO;
QueryWrapper<WorkOrderProductEntity> workOrderProductEntityQueryWrapper =new QueryWrapper<>();
workOrderProductEntityQueryWrapper.lambda().eq(WorkOrderProductEntity::getWorkId, id);
List<WorkOrderProductEntity> workOrderProductEntityList = workOrderProductService.list(workOrderProductEntityQueryWrapper);
bigworknums = workOrderProductEntityList.get(0).getProportionNum(); //成品之前加工数
retNums = new BigDecimal(workOrderForm.getWorkOrderProductList().get(0).getProportionNum()); //成品现在加工数量
bigworknums = bigworknums.add(retNums);
List<WorkOrderProductModel> workOrderProductModels =new ArrayList<>();
for (WorkOrderProductModel workOrderProductModel:workOrderForm.getWorkOrderProductList()){
//加工数量和计划加工数量对比
workOrderProductModel.setProportionNum(String.valueOf(bigworknums));
BigDecimal planNum = new BigDecimal(workOrderProductModel.getPlanNum());
BigDecimal planNum1 =planNum.subtract(retNums);
planNum = planNum.subtract(bigworknums);
int result = planNum.compareTo(zeros);
if (result>0){
// System.out.println("刚好大于0");
// workOrderForm.setStatus("4");
}else if (result==0){
// System.out.println("刚好等于0");
workOrderForm.setStatus("5");
}
else {
return ActionResult.fail("加工数量不能大于计划加工数量,"+"现在已经加工数量是"+planNum1);
}
workOrderProductModels.add(workOrderProductModel);
}
workOrderForm.setWorkOrderProductList(workOrderProductModels);
workOrderService.saveOrUpdateWork(workOrderForm,id,false);
if (workOrderForm.getType().equals("2")){
//成品生成入库单
WarehousingStorageForm warehousingStorageForm=new WarehousingStorageForm();
warehousingStorageForm.setWarehousingStorageType("14");
warehousingStorageForm.setWarehousingId(workOrderForm.getId());
warehousingStorageForm.setWarehouseId(workOrderForm.getWarehouseId());
List<WarehousingStorageProductModel> list =new ArrayList<>();
for (WorkOrderProductModel workOrderProductModel:workOrderForm.getWorkOrderProductList()){
WarehousingStorageProductModel warehousingStorageProductModel=new WarehousingStorageProductModel();
warehousingStorageProductModel.setProductId(workOrderProductModel.getProductId());
warehousingStorageProductModel.setStorageAreaId(workOrderProductModel.getCargoId());
warehousingStorageProductModel.setStorageUnit(workOrderProductModel.getUnitId()); //加工单位
warehousingStorageProductModel.setStorageNumber(workOrderProductModel.getProportionNum());
list.add(warehousingStorageProductModel);
warehousingStorageForm.setWarehousingStorageProductList(list);
}
warehousingStorageController.createWork(id,warehousingStorageForm);
//原材料生成领用单和出库单和返库单和报损单
//领用单
WarehousingReceiveForm warehousingReceiveForm=new WarehousingReceiveForm();
warehousingReceiveForm.setWarehouseId(workOrderForm.getWarehouseId()); //仓库
warehousingReceiveForm.setUsedreturnStatus("4");
warehousingReceiveForm.setUsedreturnReason("8");
warehousingReceiveForm.setBusinessId(workOrderForm.getId()); //关联单据 加工单
warehousingReceiveForm.setRemark(workOrderForm.getRemark());
List<WarehousingReceiveProductModel> warehousingReceiveList =new ArrayList<>();
String unit=workOrderForm.getWorkOrderProductList().get(0).getUnitId();
for (WorkOrderPrimaryModel WorkOrderPrimaryModel:workOrderForm.getWorkOrderPrimaryList()){
WarehousingReceiveProductModel warehousingReceiveProductModel=new WarehousingReceiveProductModel();
warehousingReceiveProductModel.setProductId(WorkOrderPrimaryModel.getProductId());
warehousingReceiveProductModel.setCargoId(WorkOrderPrimaryModel.getCargoId());
warehousingReceiveProductModel.setUsedreturnUnit(unit); //加工单位
warehousingReceiveProductModel.setUsedreturnNumber(WorkOrderPrimaryModel.getRealityNum()); //实际发货量
warehousingReceiveList.add(warehousingReceiveProductModel);
warehousingReceiveForm.setWarehousingReceiveProductList(warehousingReceiveList);
}
warehousingReceiveController.createWorkOrder(id,warehousingReceiveForm);
//出库单
WarehousingOutboundForm warehousingOutboundForm=new WarehousingOutboundForm();
// WarehousingReceiveEntity receiveentity= warehousingReceiveService.getInfo(warehousingOutboundForm.getId());
QueryWrapper<WarehousingReceiveEntity> receiveWrapper = new QueryWrapper<>();
receiveWrapper.lambda().eq(WarehousingReceiveEntity::getBusinessId, id);
// flowTaskNodeEntityQueryWrapper.lambda().eq(WarehousingReceiveEntity::getTaskId, flowTaskEntity.getId());
List<WarehousingReceiveEntity> warehousingReceiveEntityList = warehousingReceiveService.list(receiveWrapper);
warehousingOutboundForm.setWarehousingOutboundType("14");
warehousingOutboundForm.setWarehousingId(warehousingReceiveEntityList.get(0).getId());
warehousingOutboundForm.setWarehouseId(warehousingReceiveForm.getWarehouseId());
List<WarehousingOutboundProductModel> warehousingOutboundProductModelList =new ArrayList<>();
for (WarehousingReceiveProductModel warehousingReceiveProductModel1:warehousingReceiveList){
WarehousingOutboundProductModel warehousingOutboundProductModel=new WarehousingOutboundProductModel();
warehousingOutboundProductModel.setProductId(warehousingReceiveProductModel1.getProductId());
warehousingOutboundProductModel.setOutboundAreaId(warehousingReceiveProductModel1.getCargoId());
warehousingOutboundProductModel.setOutboundUnit(unit); //加工单位
warehousingOutboundProductModel.setOutboundNumber(warehousingReceiveProductModel1.getUsedreturnNumber()); //实际发货量
warehousingOutboundProductModelList.add(warehousingOutboundProductModel);
warehousingOutboundForm.setWarehousingOutboundProductList(warehousingOutboundProductModelList);
}
warehousingOutboundController.createWork(id,warehousingOutboundForm);
//返库单
WarehousingReturnForm warehousingReturnForm=new WarehousingReturnForm();
warehousingReturnForm.setBusinessId(workOrderForm.getId());
warehousingReturnForm.setWarehouseId(workOrderForm.getWarehouseId());
warehousingReturnForm.setReturnReason("8");
warehousingReturnForm.setRemark(workOrderForm.getRemark());
BigDecimal retNum = new BigDecimal("0");
BigDecimal zero = BigDecimal.ZERO;
List<WarehousingReturnProductModel> warehousingReturnProductModelList =new ArrayList<>();
for (WorkOrderPrimaryModel WorkOrderPrimaryModel:workOrderForm.getWorkOrderPrimaryList()){
if (WorkOrderPrimaryModel.getReturnNum()==null||WorkOrderPrimaryModel.getReturnNum().equals("0")){
}else{
WarehousingReturnProductModel warehousingReturnProductModel=new WarehousingReturnProductModel();
warehousingReturnProductModel.setProductId(WorkOrderPrimaryModel.getProductId());
warehousingReturnProductModel.setReturnUnit(unit);
warehousingReturnProductModel.setCargoId(WorkOrderPrimaryModel.getCargoId());
warehousingReturnProductModel.setReturnNumber(WorkOrderPrimaryModel.getReturnNum());
warehousingReturnProductModelList.add(warehousingReturnProductModel);
warehousingReturnForm.setWarehousingReturnProductList(warehousingReturnProductModelList);
retNum =new BigDecimal(WorkOrderPrimaryModel.getReturnNum());
}
}
if (retNum.compareTo(zero)>0){
warehousingReturnController.createWork(id,warehousingReturnForm);
}
//报损单
WarehousingReportlossForm warehousingReportlossForm=new WarehousingReportlossForm();
warehousingReportlossForm.setReportlossType("4");
warehousingReportlossForm.setReportlossReason("5");
warehousingReportlossForm.setWarehouseId(workOrderForm.getWarehouseId());
warehousingReportlossForm.setBusinessId(workOrderForm.getId());
warehousingReportlossForm.setRemark(workOrderForm.getRemark());
BigDecimal retNum1 = new BigDecimal("0");
BigDecimal zero1 = BigDecimal.ZERO;
List<WarehousingReportlossProductModel> warehousingReportlossProductModelList =new ArrayList<>();
for (WorkOrderPrimaryModel WorkOrderPrimaryModel:workOrderForm.getWorkOrderPrimaryList()){
if (WorkOrderPrimaryModel.getReportlossNum()==null||WorkOrderPrimaryModel.getReportlossNum().equals("0")){
}else{
WarehousingReportlossProductModel warehousingReportlossProductModel=new WarehousingReportlossProductModel();
warehousingReportlossProductModel.setProductId(WorkOrderPrimaryModel.getProductId());
warehousingReportlossProductModel.setReportlossUnit(unit);
warehousingReportlossProductModel.setCargoId(WorkOrderPrimaryModel.getCargoId());
warehousingReportlossProductModel.setReportlossNumber(WorkOrderPrimaryModel.getReportlossNum());
warehousingReportlossProductModelList.add(warehousingReportlossProductModel);
warehousingReportlossForm.setWarehousingReportlossProductList(warehousingReportlossProductModelList);
retNum1 =new BigDecimal(WorkOrderPrimaryModel.getReportlossNum());
}
}
if (retNum1.compareTo(zero1)>0){
warehousingReportlossController.createWork(id,warehousingReportlossForm);
}
}
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
}

@ -245,6 +245,8 @@ public class ProductWarehouseEntity {
@TableField(exist = false)
private String salesMainUnitIds;
@TableField(exist = false)
private String theoryNum;
@TableField(exist = false)
private String inventoryUnitIds;
@TableField(exist = false)
private String operateUnitIds;
@ -265,4 +267,9 @@ public class ProductWarehouseEntity {
private String salesOrderMultiples;
@TableField(exist = false)
private String productId;
@TableField(exist = false)
private String productTypeIds;
@TableField(exist = false)
private String inventoryTypes;
}

@ -58,6 +58,9 @@ public class WarehousingReportlossEntity {
@TableField("F_VERSION")
private Integer version;
@TableField(value = "BUSINESS_ID" , updateStrategy = FieldStrategy.IGNORED)
private String businessId;
@TableField(exist = false)
private String reportlossSum;
}

@ -51,4 +51,10 @@ public class WorkOrderPrimaryEntity {
@TableField(value = "CARGO_ID" , updateStrategy = FieldStrategy.IGNORED)
private String cargoId;
@TableField(value = "RETURN_NUM" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal returnNum;
@TableField(value = "REPORTLOSS_NUM" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal reportlossNum;
}

@ -56,4 +56,10 @@ public class WorkOrderProductEntity {
@TableField(value = "CARGO_ID" , updateStrategy = FieldStrategy.IGNORED)
private String cargoId;
@TableField(value = "PLAN_NUM" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal planNum;
@TableField(exist = false)
private BigDecimal nums;
}

@ -44,4 +44,7 @@ public class WarehousingReportlossForm {
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 关联单据 **/
@JsonProperty("businessId")
private String businessId;
}

@ -1,5 +1,7 @@
package jnpf.model.workorder;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.util.List;
import java.util.Date;
@ -30,4 +32,12 @@ public class WorkOrderPrimaryModel {
@JSONField(name = "cargoId")
private String cargoId;
/** 原料返库数量 **/
@JSONField(name = "returnNum")
private String returnNum;
/** 原料报损数量 **/
@JSONField(name = "reportlossNum")
private String reportlossNum;
}

@ -1,5 +1,7 @@
package jnpf.model.workorder;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.util.List;
import java.util.Date;
@ -39,4 +41,7 @@ public class WorkOrderProductModel {
@JSONField(name = "cargoId")
private String cargoId;
@JSONField(name = "planNum")
private String planNum;
}

@ -1,16 +1,18 @@
<template>
<el-dialog title="选择商品" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-dialog title="选择商品" :close-on-click-modal="false" :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable
@keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
<el-button type="primary" icon="el-icon-search"
@click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
@ -19,16 +21,18 @@
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange"
:border="false">
<el-table-column prop="name" label="商品名称" align="left">
</el-table-column>
<el-table-column prop="code" label="商品编码" align="left">
</el-table-column>
<el-table-column prop="productTypeId" label="商品类型" align="left">
<el-table-column prop="productTypeIds" label="商品类型" align="left">
</el-table-column>
<el-table-column prop="shortName" label="商品简称" align="left">
</el-table-column>
@ -36,7 +40,7 @@
</el-table-column>
<el-table-column prop="barCode" label="商品条码" align="left">
</el-table-column>
<el-table-column prop="inventoryType" label="存货类型" align="left">
<el-table-column prop="inventoryTypes" label="存货类型" align="left">
</el-table-column>
<!-- <el-table-column prop="brandId" label="品牌" align="left">
</el-table-column> -->
@ -53,7 +57,8 @@
<el-table-column prop="inventoryUnitIds" label="库存单位" align="left">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
@ -140,7 +145,7 @@ export default {
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
>>> .el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;

@ -1,16 +1,18 @@
<template>
<el-dialog title="选择商品" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-dialog title="选择商品" :close-on-click-modal="false" :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center" lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable
@keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
<el-button type="primary" icon="el-icon-search"
@click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
@ -19,17 +21,18 @@
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list"
@current-change="clickRow" highlight-current-row ref="tablelistref" :border="false">
<JNPF-table v-loading="listLoading" :data="list" @current-change="clickRow"
highlight-current-row ref="tablelistref" :border="false">
<el-table-column prop="name" label="商品名称" align="left">
</el-table-column>
<el-table-column prop="code" label="商品编码" align="left">
</el-table-column>
<el-table-column prop="productTypeId" label="商品类型" align="left">
<el-table-column prop="productTypeIds" label="商品类型" align="left">
</el-table-column>
<el-table-column prop="shortName" label="商品简称" align="left">
</el-table-column>
@ -37,24 +40,13 @@
</el-table-column>
<el-table-column prop="barCode" label="商品条码" align="left">
</el-table-column>
<el-table-column prop="inventoryType" label="存货类型" align="left">
<el-table-column prop="inventoryTypes" label="存货类型" align="left">
</el-table-column>
<!-- <el-table-column prop="brandId" label="品牌" align="left">
</el-table-column> -->
<!-- <el-table-column prop="productCategoryId" label="商品分类" align="left">
</el-table-column> -->
<!-- <el-table-column prop="area" label="产地" align="left">
</el-table-column>
<el-table-column prop="firstSupplierId" label="首选供应商" align="left">
</el-table-column> -->
<!-- <el-table-column prop="deliveryType" label="配送方式" align="left">
</el-table-column> -->
<!-- <el-table-column prop="salesMainUnitIds" label="销售单位" align="left">
</el-table-column> -->
<el-table-column prop="inventoryUnitIds" label="库存单位" align="left">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
@ -101,15 +93,13 @@ export default {
dataType: 0,
id: val,
}
/* GoodsList(query).then(res => {
this.list = res.data.list
this.listLoading = false
}) */
request({
url: `/api/scm/ProductWarehouse/getBomProductlist`,
method: 'post',
data: query
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.pagination.total
@ -142,7 +132,7 @@ export default {
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
>>> .el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;

@ -259,29 +259,12 @@
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.unitId"
<JnpfInput v-model="scope.row.unitIds"
@change="changeData('workorderproduct-unitId', scope.$index)"
placeholder="请输入" disabled clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="加工数量" v-if="judgeShow('workorderproduct-proportionNum')"
align="center" prop="proportionNum" width="180px">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderproductList-proportionNum')">*</span>加工数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.proportionNum"
@change="changeData('workorderproduct-proportionNum', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('workorderproductList') || judgeWrite('workorderproductList-proportionNum')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="BOM" v-if="judgeShow('workorderproduct-bomId')" prop="bomId"
align="center" width="300px">
<template slot="header">
@ -301,6 +284,38 @@
</JnpfPopupSelect>
</template>
</el-table-column>
<el-table-column label="计划加工数量" v-if="judgeShow('workorderproduct-planNum')"
align="center" prop="planNum" width="180px">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderproductList-planNum')">*</span>计划加工数量
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.planNum" placeholder="请输入"
@input="planNum(scope.row.planNum,scope.$index)" clearable
@clear="clearables(scope.$index)" :style='{ "width": "100%" }'>
</el-input>
</template>
</el-table-column>
<el-table-column label="加工数量" v-if="judgeShow('workorderproduct-proportionNum')"
align="center" prop="proportionNum" width="180px">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderproductList-proportionNum')">*</span>加工数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.proportionNum"
@change="changeData('workorderproduct-proportionNum', scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('workorderproductList') || judgeWrite('workorderproductList-proportionNum')"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="参考成本价" v-if="judgeShow('workorderproduct-cost')" prop="cost"
align="center" width="180px">
@ -484,37 +499,54 @@
<span class="required-sign"
v-if="judgeRequired('workorderprimaryList-theoryNum')">*</span>理论发料量
</template>
<!-- <template slot-scope="scope">
<JnpfInput v-model="scope.row.theoryNum"
@change="changeData('workorderprimary-theoryNum',scope.$index)"
placeholder="请输入"
:disabled="judgeWrite('workorderprimaryList')||judgeWrite('workorderprimaryList-theoryNum')"
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template> -->
<template slot-scope="scope">
<JnpfInput v-model="scope.row.theoryNum"
<JnpfInput v-model="scope.row.theoryNum" disabled
@change="changeData('workorderprimary-theoryNum', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="实际发料量" v-if="judgeShow('workorderprimary-realityNum')"
align="center" prop="realityNum">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderprimaryList-realityNum')">*</span>实际发料量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.realityNum"
@change="changeData('workorderprimary-realityNum', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="原料返库数量" v-if="judgeShow('workorderprimary-returnNum')"
align="center" prop="returnNum">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderprimaryList-returnNum')">*</span>原料返库数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.returnNum"
@change="changeData('workorderprimary-returnNum', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="原料报损数量" v-if="judgeShow('workorderprimary-reportlossNum')"
align="center" prop="reportlossNum">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('workorderprimaryList-reportlossNum')">*</span>原料报损数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.reportlossNum"
@change="changeData('workorderprimary-reportlossNum', scope.$index)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="货区名称" v-if="judgeShow('workorderprimary-cargoId')"
@ -586,6 +618,7 @@ import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime }
import { thousandsFormat } from "@/components/Generator/utils/index"
import BomProductGoodsBoxOnly from '@/views/scm/publicPopup/BomProductGoodsBoxOnly'
import BomProductRawGoodsBox from '@/views/scm/publicPopup/BomProductGoodsBox'
import jnpf from '@/utils/jnpf';
export default {
@ -623,9 +656,11 @@ export default {
workOrderProductList: {
productId: '',
productIdOptions: [],
unitIds: '',
unitId: '',
unitIdOptions: [],
proportionNum: '',
planNum: '',
proportionNumOptions: [],
bomId: '',
bomIdOptions: [],
@ -776,6 +811,7 @@ export default {
workorderprimarycargoId: [{ "fieldName": "", "field": "businessOrganizeId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "AyAmdw1", "relationField": "warehouseId", "required": "0" }],
},
oldtheoryNum: {}
}
},
computed: {
@ -820,7 +856,7 @@ export default {
},
changeDataBom(model, index) {
this.dataForm.workOrderPrimaryList = index.productWarehouseEntityList
this.oldtheoryNum = JSON.parse(JSON.stringify(this.dataForm.workOrderPrimaryList))
},
changeData(model, index) {
this.isEdit = false
@ -845,6 +881,39 @@ export default {
}
}
},
clearables(index) {
if (this.dataForm.workOrderProductList[index].planNum == '') {
this.oldtheoryNum.filter((item) => {
this.dataForm.workOrderPrimaryList.filter((sub) => {
if (item.productId == sub.productId) {
sub.theoryNum = item.theoryNum
}
})
})
}
},
planNum(val, index) {
//bombom
if (this.dataForm.workOrderPrimaryList.length == 0) {
this.$alert('请先选择BOM', {
confirmButtonText: '确定',
});
this.dataForm.workOrderProductList[index].planNum = undefined
} else {
//bom
if (val == 0) {
this.dataForm.workOrderPrimaryList.filter((item) => {
item.theoryNum = this.jnpf.floatMul(item.theoryNum, 1)
})
} else {
this.dataForm.workOrderPrimaryList.filter((item) => {
item.theoryNum = this.jnpf.floatMul(item.theoryNum, val)
})
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
@ -944,6 +1013,15 @@ export default {
isOk = false
break
}
if (!e.planNum) {
this.$message({
message: '计划加工数量不能为空',
type: 'error',
duration: 1000
});
isOk = false
break
}
if (!e.bomId) {
this.$message({
message: 'BOM不能为空',
@ -993,15 +1071,17 @@ export default {
}
},
initList(list) {
console.log(list);
let item = {
productId: list.id,
name: list.name,
spec: list.spec,
inventoryType: list.inventoryType,
inventoryType: list.inventoryTypes,
inventoryUnitIds: list.inventoryUnitIds,
salesMainUnitIds: list.salesMainUnitIds,
barCode: list.barCode,
unitId: list.operateUnitIds,
unitIds: list.operateUnitIds,
unitId: list.operateUnitId,
productTypeIds: list.productTypeId,
}
this.dataForm.workOrderProductList.push(item)
@ -1052,6 +1132,7 @@ export default {
productId: '',
unitId: '',
proportionNum: undefined,
planNum: undefined,
bomId: '',
cargoId: '',
cost: undefined,

@ -76,8 +76,8 @@
<el-tag v-if="scope.row.status == 1"></el-tag>
<el-tag type="success" v-else-if="scope.row.status == 2">待加工</el-tag>
<el-tag type="danger" v-else-if="scope.row.status == 3">加工中</el-tag>
<el-tag type="info" v-else-if="scope.row.status == 4">加工完成</el-tag>
<el-tag type="info" v-else-if="scope.row.status == 5">已取消</el-tag>
<el-tag type="info" v-else-if="scope.row.status == 5">加工完成</el-tag>
<el-tag type="info" v-else-if="scope.row.status == 6">已取消</el-tag>
</template>
</el-table-column>

Loading…
Cancel
Save