|
|
@ -14,6 +14,7 @@ import com.ruoyi.system.mapper.BaseRequisitioningOrderMapper; |
|
|
|
import com.ruoyi.system.domain.BaseRequisitioningOrder; |
|
|
|
import com.ruoyi.system.service.IBaseRequisitioningOrderService; |
|
|
|
import com.ruoyi.common.core.text.Convert; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
/** |
|
|
|
* 请购单Service业务层处理 |
|
|
@ -64,6 +65,7 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = NullPointerException.class) |
|
|
|
public int insertBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) |
|
|
|
{ |
|
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
@ -71,11 +73,14 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr |
|
|
|
baseRequisitioningOrder.setCreateTime(DateUtils.getNowDate()); |
|
|
|
baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG")); |
|
|
|
List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList(); |
|
|
|
for (BaseRequisitioningOrderChild child: childList) { |
|
|
|
child.setQuoteId(baseRequisitioningOrder.getRequisitioningCode()); |
|
|
|
child.setCreateBy(loginName); |
|
|
|
child.setCreateTime(DateUtils.getNowDate()); |
|
|
|
baseRequisitioningOrderChildMapper.insertBaseRequisitioningOrderChild(child); |
|
|
|
int childSize = childList.size(); |
|
|
|
if (childSize > 0) { |
|
|
|
for (BaseRequisitioningOrderChild child : childList) { |
|
|
|
child.setQuoteId(baseRequisitioningOrder.getRequisitioningCode()); |
|
|
|
child.setCreateBy(loginName); |
|
|
|
child.setCreateTime(DateUtils.getNowDate()); |
|
|
|
baseRequisitioningOrderChildMapper.insertBaseRequisitioningOrderChild(child); |
|
|
|
} |
|
|
|
} |
|
|
|
return baseRequisitioningOrderMapper.insertBaseRequisitioningOrder(baseRequisitioningOrder); |
|
|
|
} |
|
|
@ -87,6 +92,7 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = NullPointerException.class) |
|
|
|
public int updateBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) |
|
|
|
{ |
|
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
|