|
|
|
@ -1,9 +1,11 @@ |
|
|
|
package com.gaotao.modules.finishedProduct.sap.service.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.gaotao.common.constant.SysMsgConstant; |
|
|
|
import com.gaotao.common.utils.DateUtils; |
|
|
|
import com.gaotao.common.utils.R; |
|
|
|
import com.gaotao.common.utils.RandomUtil; |
|
|
|
import com.gaotao.modules.finishedProduct.dao.CRollinfoDao; |
|
|
|
import com.gaotao.modules.finishedProduct.entity.CRollinfoEntity; |
|
|
|
import com.gaotao.modules.finishedProduct.entity.Part; |
|
|
|
import com.gaotao.modules.finishedProduct.sap.dao.SapViewDao; |
|
|
|
@ -12,6 +14,7 @@ import com.gaotao.modules.finishedProduct.service.CRollinfoService; |
|
|
|
import com.gaotao.modules.finishedProduct.service.PartService; |
|
|
|
import com.gaotao.modules.finishedProduct.service.TransheaderService; |
|
|
|
import com.gaotao.modules.finishedProduct.vo.CRollInfoStorageVo; |
|
|
|
import com.gaotao.modules.report.dao.ProcedureDao; |
|
|
|
import com.gaotao.modules.schedule.mapper.ProcedureMapper; |
|
|
|
import com.gaotao.modules.sys.entity.SysUserEntity; |
|
|
|
import com.gaotao.modules.sys.service.SysMsgService; |
|
|
|
@ -28,7 +31,7 @@ import java.util.*; |
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
@SuppressWarnings("all") |
|
|
|
public class SapRollServiceImpl implements SapRollService { |
|
|
|
public class SapRollServiceImpl extends ServiceImpl<CRollinfoDao, CRollinfoEntity> implements SapRollService { |
|
|
|
|
|
|
|
private static final String SAP_SOURCE_TYPE = "SAP成品入库"; |
|
|
|
private static final String SAP_TRANS_TYPE_IN = "SOI"; |
|
|
|
@ -44,7 +47,7 @@ public class SapRollServiceImpl implements SapRollService { |
|
|
|
private PartService partService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ProcedureMapper procedureMapper; |
|
|
|
private ProcedureDao procedureDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysMsgService sysMsgService; |
|
|
|
@ -55,17 +58,18 @@ public class SapRollServiceImpl implements SapRollService { |
|
|
|
@Override |
|
|
|
public R sapOutRollno(CRollinfoEntity rollno) { |
|
|
|
SysUserEntity user = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
CRollinfoEntity cRollInfo = cRollinfoService.lambdaQuery() |
|
|
|
CRollinfoEntity cRollInfo = lambdaQuery() |
|
|
|
.eq(StringUtils.isNotEmpty(rollno.getRollno()), CRollinfoEntity::getRollno, rollno.getRollno()) |
|
|
|
.eq(CRollinfoEntity::getSite, user.getSite()) |
|
|
|
.eq(CRollinfoEntity::getSourcetype, SAP_SOURCE_TYPE) |
|
|
|
.one(); |
|
|
|
.eq(StringUtils.isNotEmpty(rollno.getStatusDb()), CRollinfoEntity::getStatusDb, rollno.getStatusDb()) |
|
|
|
.eq(StringUtils.isNotEmpty(rollno.getSite()), CRollinfoEntity::getSite, rollno.getSite()).one(); |
|
|
|
if (cRollInfo == null) { |
|
|
|
return R.error(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200105)); |
|
|
|
} |
|
|
|
if (!"I".equals(cRollInfo.getStatusDb())) { |
|
|
|
|
|
|
|
if (!cRollInfo.getStatusDb().equals("I")) { |
|
|
|
return R.error(sysMsgService.getLanguageMsg(SysMsgConstant.OBJECT_ID_200106) + cRollInfo.getStatus()); |
|
|
|
} |
|
|
|
|
|
|
|
return R.ok().put("cRollinfo", cRollInfo); |
|
|
|
} |
|
|
|
|
|
|
|
@ -142,7 +146,7 @@ public class SapRollServiceImpl implements SapRollService { |
|
|
|
CRollinfoEntity dbRoll = cRollinfoService.lambdaQuery() |
|
|
|
.eq(CRollinfoEntity::getRollno, item.getRollno()) |
|
|
|
.eq(CRollinfoEntity::getSite, user.getSite()) |
|
|
|
.eq(CRollinfoEntity::getSourcetype, SAP_SOURCE_TYPE) |
|
|
|
//.eq(CRollinfoEntity::getSourcetype, SAP_SOURCE_TYPE) |
|
|
|
.eq(CRollinfoEntity::getStatusDb, "I") |
|
|
|
.one(); |
|
|
|
if (dbRoll == null) { |
|
|
|
|