|
|
@ -1,12 +1,16 @@ |
|
|
|
package com.ruoyi.system.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import com.ruoyi.common.core.redis.RedisCache; |
|
|
|
import com.ruoyi.common.core.text.Convert; |
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
|
import com.ruoyi.system.domain.SysMakeOrder; |
|
|
|
import com.ruoyi.system.domain.SysSalesOrderChild; |
|
|
|
import com.ruoyi.system.mapper.SysMakeOrderMapper; |
|
|
|
import com.ruoyi.system.service.ISysMakeOrderService; |
|
|
|
import com.ruoyi.system.service.ISysMakeorderDeptService; |
|
|
|
import com.ruoyi.system.service.ISysSalesOrderChildService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -19,7 +23,7 @@ import java.util.List; |
|
|
|
* @date 2023-12-18 |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class SysMakeOrderServiceImpl implements ISysMakeOrderService |
|
|
|
public class SysMakeOrderServiceImpl implements ISysMakeOrderService |
|
|
|
{ |
|
|
|
@Autowired |
|
|
|
private SysMakeOrderMapper sysMakeOrderMapper; |
|
|
@ -27,6 +31,12 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService |
|
|
|
@Autowired |
|
|
|
private RedisCache redisCache; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ISysMakeorderDeptService makeorderDeptService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ISysSalesOrderChildService salesOrderChildService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询生产订单 |
|
|
|
* |
|
|
@ -63,12 +73,6 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService |
|
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
|
sysMakeOrder.setCreateBy(loginName); |
|
|
|
sysMakeOrder.setCreateTime(DateUtils.getNowDate()); |
|
|
|
String makeNo = redisCache.generateBillNo("PO"); |
|
|
|
sysMakeOrder.setMakeNo(makeNo); |
|
|
|
sysMakeOrder.setUseStatus("0"); |
|
|
|
sysMakeOrder.setMakeStatus("0"); |
|
|
|
sysMakeOrder.setEceiptStatus("0"); |
|
|
|
sysMakeOrder.setQualityStatus("0"); |
|
|
|
return sysMakeOrderMapper.insertSysMakeOrder(sysMakeOrder); |
|
|
|
} |
|
|
|
|
|
|
@ -160,4 +164,26 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService |
|
|
|
public Integer selectSysMakeOrderByFinsh() { |
|
|
|
return sysMakeOrderMapper.selectSysMakeOrderByFinsh(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void generateMakeOrderBySalesOrderCode(String salesOrderCode) { |
|
|
|
SysMakeOrder makeOrder = new SysMakeOrder(); |
|
|
|
// 待评审
|
|
|
|
makeOrder.setMakeStatus("1"); |
|
|
|
// 是
|
|
|
|
makeOrder.setUseStatus("1"); |
|
|
|
makeOrder.setSaleNo(salesOrderCode); |
|
|
|
String makeNo = redisCache.generateBillNo("PO"); |
|
|
|
makeOrder.setMakeNo(makeNo); |
|
|
|
insertSysMakeOrder(makeOrder); |
|
|
|
// 生成部门待预审数据
|
|
|
|
List<SysSalesOrderChild> salesOrderChildList = salesOrderChildService.selectSysSalesOrderChildByQuoteId(salesOrderCode); |
|
|
|
if(CollectionUtil.isNotEmpty(salesOrderChildList)){ |
|
|
|
salesOrderChildList.forEach(t->{ |
|
|
|
String materialCode = t.getMaterialCode(); |
|
|
|
makeorderDeptService.generateYsDataByMakeNoAndMaterialNo(makeNo,materialCode); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|