Commit 59593aaf authored by 李驰骋's avatar 李驰骋

国际化添加

parent 30b99676
...@@ -14,6 +14,7 @@ import com.topsunit.scanservice.ximai.dto.mapper.LoginMapper; ...@@ -14,6 +14,7 @@ import com.topsunit.scanservice.ximai.dto.mapper.LoginMapper;
import com.topsunit.scanservice.ximai.entity.Cmsmv; import com.topsunit.scanservice.ximai.entity.Cmsmv;
import com.topsunit.scanservice.ximai.entity.ExAccountInfo; import com.topsunit.scanservice.ximai.entity.ExAccountInfo;
import com.topsunit.scanservice.ximai.security.*; import com.topsunit.scanservice.ximai.security.*;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import com.topsunit.scanservice.ximai.webapi.MesLoginService; import com.topsunit.scanservice.ximai.webapi.MesLoginService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
...@@ -75,13 +76,13 @@ public class CmsmvService { ...@@ -75,13 +76,13 @@ public class CmsmvService {
i.setToken(tokenManger.generate(i.getMv001(), Locale.getDefault().toString(),loginParams.getCompany())); i.setToken(tokenManger.generate(i.getMv001(), Locale.getDefault().toString(),loginParams.getCompany()));
return i; return i;
}) })
.orElseThrow(() -> new TopsunitException("用户名或密码错误。")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("用户名或密码错误。")));
} }
public LoginResult loginByMes(LoginParams loginParams) { public LoginResult loginByMes(LoginParams loginParams) {
com.topsunit.scanservice.ximai.webapi.dto.LoginParams loginParams2 = BeanUtil.copyProperties(loginParams, com.topsunit.scanservice.ximai.webapi.dto.LoginParams.class); com.topsunit.scanservice.ximai.webapi.dto.LoginParams loginParams2 = BeanUtil.copyProperties(loginParams, com.topsunit.scanservice.ximai.webapi.dto.LoginParams.class);
com.topsunit.scanservice.ximai.webapi.dto.LoginResult loginResult2 = mesLoginService.login(loginParams2); com.topsunit.scanservice.ximai.webapi.dto.LoginResult loginResult2 = mesLoginService.login(loginParams2);
ExAccountInfo exAccountInfo = exAccountInfoDao.findById(Integer.valueOf(loginParams.getCompany())).orElseThrow(()->new TopsunitException("未找到登录账套")); ExAccountInfo exAccountInfo = exAccountInfoDao.findById(Integer.valueOf(loginParams.getCompany())).orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到登录账套")));
if(loginResult2.getCode()==500){ if(loginResult2.getCode()==500){
throw new TopsunitException(loginResult2.getMsg()); throw new TopsunitException(loginResult2.getMsg());
} }
...@@ -94,22 +95,22 @@ public class CmsmvService { ...@@ -94,22 +95,22 @@ public class CmsmvService {
@Transactional @Transactional
public void setPassword(SetPasswordParams params) { public void setPassword(SetPasswordParams params) {
Cmsmv cmsmv = cmsmvDao.findById(params.getMv001()).orElseThrow(() -> new TopsunitException("用户不存在")); Cmsmv cmsmv = cmsmvDao.findById(params.getMv001()).orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("用户不存在")));
if (!StringUtil.isNullOrEmpty(cmsmv.getUdf01())) { if (!StringUtil.isNullOrEmpty(cmsmv.getUdf01())) {
throw new TopsunitException("已经设置密码"); throw new TopsunitException(MessageUtils.getMessage("已经设置密码"));
} }
cmsmv.setUdf01(encryptor.hash(params.getPassword())); cmsmv.setUdf01(encryptor.hash(params.getPassword()));
} }
@Transactional @Transactional
public void changePassword(ChangePasswordParams params) { public void changePassword(ChangePasswordParams params) {
Cmsmv cmsmv = cmsmvDao.findById(currentActor.getActor().getMv001()).orElseThrow(() -> new TopsunitException("用户不存在")); Cmsmv cmsmv = cmsmvDao.findById(currentActor.getActor().getMv001()).orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("用户不存在")));
if (StringUtil.isNullOrEmpty(cmsmv.getUdf01())) { if (StringUtil.isNullOrEmpty(cmsmv.getUdf01())) {
if (!params.getOldPassWord().equals(appConfig.getDefaultPassword())) { if (!params.getOldPassWord().equals(appConfig.getDefaultPassword())) {
throw new TopsunitException("原密码输入有误"); throw new TopsunitException(MessageUtils.getMessage("原密码输入有误"));
} }
} else if (!isMatchPassword(params.getOldPassWord(), cmsmv.getUdf01())) { } else if (!isMatchPassword(params.getOldPassWord(), cmsmv.getUdf01())) {
throw new TopsunitException("原密码输入有误"); throw new TopsunitException(MessageUtils.getMessage("原密码输入有误"));
} }
cmsmv.setUdf01(encryptor.hash(params.getNewPassword())); cmsmv.setUdf01(encryptor.hash(params.getNewPassword()));
} }
......
...@@ -9,6 +9,7 @@ import com.topsunit.scanservice.ximai.dao.CoptnDao; ...@@ -9,6 +9,7 @@ import com.topsunit.scanservice.ximai.dao.CoptnDao;
import com.topsunit.scanservice.ximai.dao.CoptoDao; import com.topsunit.scanservice.ximai.dao.CoptoDao;
import com.topsunit.scanservice.ximai.dto.*; import com.topsunit.scanservice.ximai.dto.*;
import com.topsunit.scanservice.ximai.entity.*; import com.topsunit.scanservice.ximai.entity.*;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.hibernate.service.spi.ServiceException; import org.hibernate.service.spi.ServiceException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -36,7 +37,7 @@ public class CopthService { ...@@ -36,7 +37,7 @@ public class CopthService {
@Transactional @Transactional
public void create(StockSaleOutParams params){ public void create(StockSaleOutParams params){
Coptn coptn = coptnDao.findFirstByTn001AndTn002("251", params.getApplyNo()) Coptn coptn = coptnDao.findFirstByTn001AndTn002("251", params.getApplyNo())
.orElseThrow(()->new TopsunitException("未找到出货通知单:"+params.getApplyNo())); .orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到出货通知单:")+params.getApplyNo()));
BigDecimal total = BigDecimal.ZERO; BigDecimal total = BigDecimal.ZERO;
Calendar curr = Calendar.getInstance(); Calendar curr = Calendar.getInstance();
String currStr = cn.hutool.core.date.DateUtil.format(curr.getTime(), "yyyyMMdd"); String currStr = cn.hutool.core.date.DateUtil.format(curr.getTime(), "yyyyMMdd");
...@@ -53,7 +54,7 @@ public class CopthService { ...@@ -53,7 +54,7 @@ public class CopthService {
for(StockSaleOutParams.StockSaleOutDetail s : params.getData()){ for(StockSaleOutParams.StockSaleOutDetail s : params.getData()){
//查询出货通知单明细 //查询出货通知单明细
Copto copto = coptoDao.findFirstByTo001AndTo002AndTo007("251", params.getApplyNo(), s.getMaterialNo()) Copto copto = coptoDao.findFirstByTo001AndTo002AndTo007("251", params.getApplyNo(), s.getMaterialNo())
.orElseThrow(()->new TopsunitException(String.format("未找到出货通知单明细:%s,%s", params.getApplyNo(), s.getMaterialNo()))); .orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到出货通知单明细:{0},{1}", params.getApplyNo(), s.getMaterialNo())));
CopthCreateParams copthCreateParams = new CopthCreateParams(); CopthCreateParams copthCreateParams = new CopthCreateParams();
Copth copth = BeanUtil.copyProperties(copthCreateParams, Copth.class); Copth copth = BeanUtil.copyProperties(copthCreateParams, Copth.class);
copth.setTh001(coptg.getTg001()); copth.setTh001(coptg.getTg001());
......
...@@ -11,6 +11,7 @@ import com.topsunit.scanservice.ximai.entity.Invmb; ...@@ -11,6 +11,7 @@ import com.topsunit.scanservice.ximai.entity.Invmb;
import com.topsunit.scanservice.ximai.entity.Invml; import com.topsunit.scanservice.ximai.entity.Invml;
import com.topsunit.scanservice.ximai.entity.Invta; import com.topsunit.scanservice.ximai.entity.Invta;
import com.topsunit.scanservice.ximai.entity.Invtb; import com.topsunit.scanservice.ximai.entity.Invtb;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specification;
...@@ -119,7 +120,7 @@ public class InvtaService { ...@@ -119,7 +120,7 @@ public class InvtaService {
} }
//查询物料 //查询物料
Invmb invmb = invmbDao.findById(detail.getMaterialNo()) Invmb invmb = invmbDao.findById(detail.getMaterialNo())
.orElseThrow(()->new TopsunitException(String.format("未找到物料:%s", detail.getMaterialNo()))); .orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到对应物料:{0}", detail.getMaterialNo())));
Invtb invtb = BeanUtil.toBeanIgnoreError(invtbDto, Invtb.class); Invtb invtb = BeanUtil.toBeanIgnoreError(invtbDto, Invtb.class);
invtb.setTb001(invta.getTa001()); invtb.setTb001(invta.getTa001());
invtb.setTb002(invta.getTa002()); invtb.setTb002(invta.getTa002());
...@@ -143,7 +144,7 @@ public class InvtaService { ...@@ -143,7 +144,7 @@ public class InvtaService {
StringUtils.isNotEmpty(detail.getAllocateLocation())){ StringUtils.isNotEmpty(detail.getAllocateLocation())){
if(StrUtil.trim(detail.getAllocateWarehouse()).equals(StrUtil.trim(detail.getWarehouse())) && if(StrUtil.trim(detail.getAllocateWarehouse()).equals(StrUtil.trim(detail.getWarehouse())) &&
StrUtil.trim(detail.getAllocateLocation()).equals(StrUtil.trim(detail.getLocation()))){ StrUtil.trim(detail.getAllocateLocation()).equals(StrUtil.trim(detail.getLocation()))){
throw new TopsunitException("调拨库位与当前一致"); throw new TopsunitException(MessageUtils.getMessage("调拨库位与当前一致"));
} }
} }
if(type.equals(inventory_allocate)) { if(type.equals(inventory_allocate)) {
......
...@@ -7,6 +7,7 @@ import com.topsunit.scanservice.ximai.dto.*; ...@@ -7,6 +7,7 @@ import com.topsunit.scanservice.ximai.dto.*;
import com.topsunit.scanservice.ximai.dto.mapper.MoctcMapper; import com.topsunit.scanservice.ximai.dto.mapper.MoctcMapper;
import com.topsunit.scanservice.ximai.entity.*; import com.topsunit.scanservice.ximai.entity.*;
import com.topsunit.scanservice.ximai.security.CurrentActor; import com.topsunit.scanservice.ximai.security.CurrentActor;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -72,7 +73,7 @@ public class MoctcService { ...@@ -72,7 +73,7 @@ public class MoctcService {
.filter(j -> j.getTb004().compareTo(j.getTb005()) > 0) .filter(j -> j.getTb004().compareTo(j.getTb005()) > 0)
.collect(Collectors.toList())); .collect(Collectors.toList()));
if (i.getMoctes() == null || i.getMoctes().isEmpty()) { if (i.getMoctes() == null || i.getMoctes().isEmpty()) {
throw new TopsunitException("工单已领料完成。"); throw new TopsunitException(MessageUtils.getMessage("工单已领料完成。"));
} }
int ordinal = 1; int ordinal = 1;
for (int index = 0; index < i.getMoctes().size(); index++) { for (int index = 0; index < i.getMoctes().size(); index++) {
...@@ -103,7 +104,7 @@ public class MoctcService { ...@@ -103,7 +104,7 @@ public class MoctcService {
// 领料信息验证 // 领料信息验证
List<MocteCreateParams> mocteCreateParamsList = moctcCreateParams.getMoctes(); List<MocteCreateParams> mocteCreateParamsList = moctcCreateParams.getMoctes();
if (mocteCreateParamsList == null || mocteCreateParamsList.isEmpty()) { if (mocteCreateParamsList == null || mocteCreateParamsList.isEmpty()) {
throw new TopsunitException("没有任何领料数量。"); throw new TopsunitException(MessageUtils.getMessage("没有任何领料数量。"));
} }
moctcCreateParams.setMoctes(moctcCreateParams moctcCreateParams.setMoctes(moctcCreateParams
.getMoctes() .getMoctes()
...@@ -117,14 +118,14 @@ public class MoctcService { ...@@ -117,14 +118,14 @@ public class MoctcService {
// 工单头 // 工单头
Mocta mocta = moctaDao.findById(moctcMapper.toMoctaId(moctcCreateParams)) Mocta mocta = moctaDao.findById(moctcMapper.toMoctaId(moctcCreateParams))
.orElseThrow(() -> new TopsunitException("工单不存在")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("工单不存在")));
// 工单单身 // 工单单身
List<Moctb> moctbs = moctbDao.findByTb001AndTb002OrderByTb003AscTb006Asc(moctcCreateParams.getTa001(), moctcCreateParams.getTa002()) List<Moctb> moctbs = moctbDao.findByTb001AndTb002OrderByTb003AscTb006Asc(moctcCreateParams.getTa001(), moctcCreateParams.getTa002())
.stream() .stream()
.filter(j -> j.getTb004().compareTo(j.getTb005()) > 0) .filter(j -> j.getTb004().compareTo(j.getTb005()) > 0)
.collect(Collectors.toList()); .collect(Collectors.toList());
if (moctbs == null || moctbs.isEmpty()) { if (moctbs == null || moctbs.isEmpty()) {
throw new TopsunitException("工单已领料完成"); throw new TopsunitException(MessageUtils.getMessage("工单已领料完成"));
} }
// 领/退料单头 // 领/退料单头
...@@ -225,27 +226,27 @@ public class MoctcService { ...@@ -225,27 +226,27 @@ public class MoctcService {
Optional<Moctb> moctb = moctbs.stream().filter(i -> i.getTb003().compareTo(mocteCreateParams.getTb003()) == 0 && i.getTb006().compareTo(mocteCreateParams.getTb006()) == 0) Optional<Moctb> moctb = moctbs.stream().filter(i -> i.getTb003().compareTo(mocteCreateParams.getTb003()) == 0 && i.getTb006().compareTo(mocteCreateParams.getTb006()) == 0)
.findFirst(); .findFirst();
if (!moctb.isPresent()) { if (!moctb.isPresent()) {
throw new TopsunitException(String.format("找不到材料品号%s,工艺%s的工单单身。", mocteCreateParams.getTb003(), mocteCreateParams.getTb006())); throw new TopsunitException(MessageUtils.getMessage("找不到材料品号{0},工艺{1}的工单单身。", mocteCreateParams.getTb003(), mocteCreateParams.getTb006()));
} }
moctb.ifPresent(i -> { moctb.ifPresent(i -> {
if (i.getTb004().subtract(i.getTb005()).compareTo(mocteCreateParams.getQuantity()) < 0) { if (i.getTb004().subtract(i.getTb005()).compareTo(mocteCreateParams.getQuantity()) < 0) {
throw new TopsunitException(String.format("材料品号%s,工艺%s的领料数量超过可领数量。", mocteCreateParams.getTb003(), mocteCreateParams.getTb006())); throw new TopsunitException(MessageUtils.getMessage("材料品号{0},工艺{1}的领料数量超过可领数量。", mocteCreateParams.getTb003(), mocteCreateParams.getTb006()));
} }
}); });
// 库位验证 // 库位验证
cmsniDao.findById(new CmsniId(moctb.get().getTb009(), mocteCreateParams.getTe025())) cmsniDao.findById(new CmsniId(moctb.get().getTb009(), mocteCreateParams.getTe025()))
.orElseThrow(() -> new TopsunitException(String.format("仓库%s库位%s不存在。", moctb.get().getTb009(), mocteCreateParams.getTe025()))); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("仓库{0}库位{1}不存在。", moctb.get().getTb009(), mocteCreateParams.getTe025())));
// 批号验证 // 批号验证
invmbDao.findById(mocteCreateParams.getTb003()).ifPresent(i -> { invmbDao.findById(mocteCreateParams.getTb003()).ifPresent(i -> {
if ((!i.getMb022().equals("N")) && mocteCreateParams.getTe010().isEmpty()) { if ((!i.getMb022().equals("N")) && mocteCreateParams.getTe010().isEmpty()) {
throw new TopsunitException(String.format("批管理品号%s必须录入批号。", mocteCreateParams.getTb003())); throw new TopsunitException(MessageUtils.getMessage("批管理品号{0}必须录入批号。", mocteCreateParams.getTb003()));
} }
}); });
invmlDao.findById(new InvmlId(mocteCreateParams.getTb003(), moctb.get().getTb009(), mocteCreateParams.getTe025(), mocteCreateParams.getTe010())) invmlDao.findById(new InvmlId(mocteCreateParams.getTb003(), moctb.get().getTb009(), mocteCreateParams.getTe025(), mocteCreateParams.getTe010()))
.filter(i -> i.getMl005().compareTo(mocteCreateParams.getQuantity()) >= 0) .filter(i -> i.getMl005().compareTo(mocteCreateParams.getQuantity()) >= 0)
.orElseThrow(() -> new TopsunitException(String.format("品号%s批号%s库存不足。", mocteCreateParams.getTb003().trim(), mocteCreateParams.getTe010().trim()))); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("品号{0}批号{1}库存不足。", mocteCreateParams.getTb003().trim(), mocteCreateParams.getTe010().trim())));
Mocte mocte = new Mocte(); Mocte mocte = new Mocte();
mocte.setTe001(moctc.getTc001()); mocte.setTe001(moctc.getTc001());
......
...@@ -6,6 +6,7 @@ import com.topsunit.scanservice.ximai.common.TopsunitException; ...@@ -6,6 +6,7 @@ import com.topsunit.scanservice.ximai.common.TopsunitException;
import com.topsunit.scanservice.ximai.dao.*; import com.topsunit.scanservice.ximai.dao.*;
import com.topsunit.scanservice.ximai.dto.*; import com.topsunit.scanservice.ximai.dto.*;
import com.topsunit.scanservice.ximai.entity.*; import com.topsunit.scanservice.ximai.entity.*;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -40,9 +41,9 @@ public class MoctfService { ...@@ -40,9 +41,9 @@ public class MoctfService {
create.getDetails().forEach(s->{ create.getDetails().forEach(s->{
Moctg moctg = BeanUtil.toBeanIgnoreError(s, Moctg.class); Moctg moctg = BeanUtil.toBeanIgnoreError(s, Moctg.class);
//查询工单 //查询工单
Mocta mocta = moctaDao.findById(new MoctaId(s.getTg014(), s.getTg015())).orElseThrow(()->new TopsunitException(String.format("未找到对应工单%s,%s",s.getTg014(),s.getTg015()))); Mocta mocta = moctaDao.findById(new MoctaId(s.getTg014(), s.getTg015())).orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到对应工单:{0},{1}",s.getTg014(),s.getTg015())));
//查询物料 //查询物料
Invmb invmb = invmbDao.findById(mocta.getTa006()).orElseThrow(()->new TopsunitException(String.format("未找到对应物料:%s", s.getTg004()))); Invmb invmb = invmbDao.findById(mocta.getTa006()).orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到对应物料:{0}", s.getTg004())));
moctg.setTg004(invmb.getMb001()); moctg.setTg004(invmb.getMb001());
moctg.setTg005(invmb.getMb002()); moctg.setTg005(invmb.getMb002());
moctg.setTg006(invmb.getMb003()); moctg.setTg006(invmb.getMb003());
...@@ -51,7 +52,7 @@ public class MoctfService { ...@@ -51,7 +52,7 @@ public class MoctfService {
moctg.setTg010(invmb.getMb017()); moctg.setTg010(invmb.getMb017());
ta083.set(mocta.getTa083()); ta083.set(mocta.getTa083());
//查询物料默认仓库 //查询物料默认仓库
Invmc invmc = invmcDao.findById(new InvmcId(invmb.getMb001(), invmb.getMb017())).orElseThrow(()->new TopsunitException(String.format("未找到对应物料默认库:%s,%s", invmb.getMb001(), invmb.getMb017()))); Invmc invmc = invmcDao.findById(new InvmcId(invmb.getMb001(), invmb.getMb017())).orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到对应物料默认库:{0},{1}", invmb.getMb001(), invmb.getMb017())));
moctg.setTg036(invmc.getMc015()); moctg.setTg036(invmc.getMc015());
moctg.setTg030(currStr); moctg.setTg030(currStr);
moctg.setTg038(moctg.getTg011()); moctg.setTg038(moctg.getTg011());
......
...@@ -12,6 +12,7 @@ import com.topsunit.scanservice.ximai.entity.CmsniId; ...@@ -12,6 +12,7 @@ import com.topsunit.scanservice.ximai.entity.CmsniId;
import com.topsunit.scanservice.ximai.entity.Mocth; import com.topsunit.scanservice.ximai.entity.Mocth;
import com.topsunit.scanservice.ximai.entity.Mocti; import com.topsunit.scanservice.ximai.entity.Mocti;
import com.topsunit.scanservice.ximai.security.CurrentActor; import com.topsunit.scanservice.ximai.security.CurrentActor;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import com.topsunit.scanservice.ximai.webapi.PrintApi; import com.topsunit.scanservice.ximai.webapi.PrintApi;
import com.topsunit.scanservice.ximai.webapi.dto.PrintField; import com.topsunit.scanservice.ximai.webapi.dto.PrintField;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -154,7 +155,7 @@ public class MocthService { ...@@ -154,7 +155,7 @@ public class MocthService {
.findById(mapper.toMocthId(checkParams)) .findById(mapper.toMocthId(checkParams))
//.filter(i -> i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i -> i.getCompany().trim().equals(currentActor.getCompany().trim()))
.filter(i -> i.getTh023().trim().equals("N")) .filter(i -> i.getTh023().trim().equals("N"))
.orElseThrow(() -> new TopsunitException("委外进货单不存在或已审核")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("委外进货单不存在或已审核")));
List<Mocti> moctis = moctiDao.findByTi001AndTi002(checkParams.getTh001(), checkParams.getTh002()); List<Mocti> moctis = moctiDao.findByTi001AndTi002(checkParams.getTh001(), checkParams.getTh002());
moctis.forEach(i -> { moctis.forEach(i -> {
checkParams.getMoctis().stream() checkParams.getMoctis().stream()
...@@ -178,7 +179,7 @@ public class MocthService { ...@@ -178,7 +179,7 @@ public class MocthService {
}); });
}); });
if (moctis.stream().anyMatch(i -> i.getTi019().add(i.getTi021()).add(i.getTi022()).compareTo(i.getTi007()) > 0)) { if (moctis.stream().anyMatch(i -> i.getTi019().add(i.getTi021()).add(i.getTi022()).compareTo(i.getTi007()) > 0)) {
throw new TopsunitException("超出进货数量。"); throw new TopsunitException(MessageUtils.getMessage("超出进货数量。"));
} }
} }
...@@ -188,7 +189,7 @@ public class MocthService { ...@@ -188,7 +189,7 @@ public class MocthService {
.findById(mapper.toMocthId(putOnParams)) .findById(mapper.toMocthId(putOnParams))
//.filter(i -> i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i -> i.getCompany().trim().equals(currentActor.getCompany().trim()))
.filter(i -> i.getTh023().trim().equals("N")) .filter(i -> i.getTh023().trim().equals("N"))
.orElseThrow(() -> new TopsunitException("委外进货单不存在或已审核")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("委外进货单不存在或已审核")));
List<Mocti> moctis = moctiDao.findByTi001AndTi002(putOnParams.getTh001(), putOnParams.getTh002()); List<Mocti> moctis = moctiDao.findByTi001AndTi002(putOnParams.getTh001(), putOnParams.getTh002());
moctis.forEach(i -> { moctis.forEach(i -> {
putOnParams.getMoctis().stream() putOnParams.getMoctis().stream()
...@@ -197,7 +198,7 @@ public class MocthService { ...@@ -197,7 +198,7 @@ public class MocthService {
.ifPresent(j -> { .ifPresent(j -> {
cmsniDao.findById(new CmsniId(i.getTi009(), j.getTi060())) cmsniDao.findById(new CmsniId(i.getTi009(), j.getTi060()))
//.filter(x -> x.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(x -> x.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("库位不存在")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("库位不存在")));
mapper.updateMocti(j, i); mapper.updateMocti(j, i);
}); });
}); });
......
...@@ -9,6 +9,7 @@ import com.topsunit.scanservice.ximai.dto.*; ...@@ -9,6 +9,7 @@ import com.topsunit.scanservice.ximai.dto.*;
import com.topsunit.scanservice.ximai.dto.mapper.PurccMapper; import com.topsunit.scanservice.ximai.dto.mapper.PurccMapper;
import com.topsunit.scanservice.ximai.entity.*; import com.topsunit.scanservice.ximai.entity.*;
import com.topsunit.scanservice.ximai.security.CurrentActor; import com.topsunit.scanservice.ximai.security.CurrentActor;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import com.topsunit.scanservice.ximai.webapi.PrintApi; import com.topsunit.scanservice.ximai.webapi.PrintApi;
import com.topsunit.scanservice.ximai.webapi.dto.PrintField; import com.topsunit.scanservice.ximai.webapi.dto.PrintField;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -92,7 +93,7 @@ public class PurccService { ...@@ -92,7 +93,7 @@ public class PurccService {
.findById(purccMapper.toPurccID(purccCheckParams)) .findById(purccMapper.toPurccID(purccCheckParams))
//.filter(i -> i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i -> i.getCompany().trim().equals(currentActor.getCompany().trim()))
.filter(i -> i.getCc009().trim().equals("N")) .filter(i -> i.getCc009().trim().equals("N"))
.orElseThrow(() -> new TopsunitException("到货单不存在或已检验。")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("到货单不存在或已检验。")));
List<Purcd> purcds = purcdDao.findByCd001AndCd002(purccCheckParams.getCc001(), purccCheckParams.getCc002()); List<Purcd> purcds = purcdDao.findByCd001AndCd002(purccCheckParams.getCc001(), purccCheckParams.getCc002());
purcds.forEach(i -> purcds.forEach(i ->
purccCheckParams.getPurcds().stream() purccCheckParams.getPurcds().stream()
...@@ -108,7 +109,7 @@ public class PurccService { ...@@ -108,7 +109,7 @@ public class PurccService {
purcds.forEach(i -> { purcds.forEach(i -> {
int compare = i.getCd018().add(i.getCd019()).compareTo(i.getCd008()); int compare = i.getCd018().add(i.getCd019()).compareTo(i.getCd008());
if (compare > 0) { if (compare > 0) {
throw new TopsunitException("超出到货数量。"); throw new TopsunitException(MessageUtils.getMessage("超出到货数量。"));
} }
if (compare == 0) { if (compare == 0) {
i.setCd034("Y"); i.setCd034("Y");
...@@ -148,7 +149,7 @@ public class PurccService { ...@@ -148,7 +149,7 @@ public class PurccService {
return; return;
} }
WarehouseArrive warehouseArrive = warehouseArriveDao.findFirstByWarehouseName(printParams.getUdf01()) WarehouseArrive warehouseArrive = warehouseArriveDao.findFirstByWarehouseName(printParams.getUdf01())
.orElseThrow(()->new TopsunitException("未配置打印机:"+printParams.getUdf01())); .orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未配置打印机:")+printParams.getUdf01()));
String url = "http://%s:8085/ximaiprintservice/print/PrintLabelByBarTender"; String url = "http://%s:8085/ximaiprintservice/print/PrintLabelByBarTender";
url = String.format(url, warehouseArrive.getWarehouseName()); url = String.format(url, warehouseArrive.getWarehouseName());
...@@ -226,12 +227,12 @@ public class PurccService { ...@@ -226,12 +227,12 @@ public class PurccService {
@Transactional @Transactional
public void create(StockArrivalParams stockArrivalParams){ public void create(StockArrivalParams stockArrivalParams){
if(CollectionUtil.isEmpty(stockArrivalParams.getDetails())){ if(CollectionUtil.isEmpty(stockArrivalParams.getDetails())){
throw new TopsunitException("采购到货明细不能为空"); throw new TopsunitException(MessageUtils.getMessage("采购到货明细不能为空"));
} }
//查询任意采购单 //查询任意采购单
StockArrivalParams.StockArrivalDetail stockArrivalDetail = stockArrivalParams.getDetails().get(0); StockArrivalParams.StockArrivalDetail stockArrivalDetail = stockArrivalParams.getDetails().get(0);
Purtc purtc = purtcDao.findFirstByTc001AndTc002(stockArrivalDetail.getPurchaseType(), stockArrivalDetail.getPurchaseNo()) Purtc purtc = purtcDao.findFirstByTc001AndTc002(stockArrivalDetail.getPurchaseType(), stockArrivalDetail.getPurchaseNo())
.orElseThrow(()->new TopsunitException(String.format("未找到采购订单%s,%s", stockArrivalDetail.getPurchaseType(), stockArrivalDetail.getPurchaseNo()))); .orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到采购订单{0},{1}", stockArrivalDetail.getPurchaseType(), stockArrivalDetail.getPurchaseNo())));
Purcc purcc = BeanUtil.copyProperties(new PurccCreateParams(), Purcc.class); Purcc purcc = BeanUtil.copyProperties(new PurccCreateParams(), Purcc.class);
Calendar curr = Calendar.getInstance(); Calendar curr = Calendar.getInstance();
String currStr = cn.hutool.core.date.DateUtil.format(curr.getTime(), "yyyyMMdd"); String currStr = cn.hutool.core.date.DateUtil.format(curr.getTime(), "yyyyMMdd");
...@@ -250,9 +251,9 @@ public class PurccService { ...@@ -250,9 +251,9 @@ public class PurccService {
int i=1; int i=1;
for(StockArrivalParams.StockArrivalDetail detail : stockArrivalParams.getDetails()){ for(StockArrivalParams.StockArrivalDetail detail : stockArrivalParams.getDetails()){
Purtd purtd = purtdDao.findFirstByTd001AndTd002AndTd003(detail.getPurchaseType(), detail.getPurchaseNo(), detail.getPurchaseSerial()) Purtd purtd = purtdDao.findFirstByTd001AndTd002AndTd003(detail.getPurchaseType(), detail.getPurchaseNo(), detail.getPurchaseSerial())
.orElseThrow(()->new TopsunitException(String.format("未找到采购订单%s,%s,%s", detail.getPurchaseType(), detail.getPurchaseNo(), detail.getPurchaseSerial()))); .orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到采购订单{0},{1},{2}", detail.getPurchaseType(), detail.getPurchaseNo(), detail.getPurchaseSerial())));
Invmb invmb = invmbDao.findById(detail.getMaterialNo()).orElseThrow(()->new TopsunitException("未找到物料:"+detail.getMaterialNo())); Invmb invmb = invmbDao.findById(detail.getMaterialNo()).orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到物料:")+detail.getMaterialNo()));
Purcd purcd = BeanUtil.copyProperties(new PurcdCreateParams(), Purcd.class); Purcd purcd = BeanUtil.copyProperties(new PurcdCreateParams(), Purcd.class);
purcd.setCd001(purcc.getCc001()); purcd.setCd001(purcc.getCc001());
purcd.setCd002(purcc.getCc002()); purcd.setCd002(purcc.getCc002());
...@@ -280,10 +281,10 @@ public class PurccService { ...@@ -280,10 +281,10 @@ public class PurccService {
public void validate(StockArrivalValidateParams params){ public void validate(StockArrivalValidateParams params){
Optional<Purtd> purtdOp = purtdDao.findFirstByTd001AndTd002AndTd003(params.getPurchaseType(), params.getPurchaseNo(), params.getPurchaseSerial()); Optional<Purtd> purtdOp = purtdDao.findFirstByTd001AndTd002AndTd003(params.getPurchaseType(), params.getPurchaseNo(), params.getPurchaseSerial());
if(!purtdOp.isPresent()){ if(!purtdOp.isPresent()){
throw new TopsunitException(String.format("未找到采购订单%s,%s,%s", params.getPurchaseType(), params.getPurchaseNo(), params.getPurchaseSerial())); throw new TopsunitException(MessageUtils.getMessage("未找到采购订单{0},{1},{2}", params.getPurchaseType(), params.getPurchaseNo(), params.getPurchaseSerial()));
} }
if(!purtdOp.get().getTd004().trim().equals(params.getMaterialNo().trim())){ if(!purtdOp.get().getTd004().trim().equals(params.getMaterialNo().trim())){
throw new TopsunitException(String.format("未找到采购订单%s,%s,%s", params.getPurchaseType(), params.getPurchaseNo(), params.getPurchaseSerial())); throw new TopsunitException(MessageUtils.getMessage("未找到采购订单{0},{1},{2}", params.getPurchaseType(), params.getPurchaseNo(), params.getPurchaseSerial()));
} }
} }
......
...@@ -7,6 +7,7 @@ import com.topsunit.scanservice.ximai.dao.*; ...@@ -7,6 +7,7 @@ import com.topsunit.scanservice.ximai.dao.*;
import com.topsunit.scanservice.ximai.dto.PurtaCreateParams; import com.topsunit.scanservice.ximai.dto.PurtaCreateParams;
import com.topsunit.scanservice.ximai.dto.PurtrCreateParams; import com.topsunit.scanservice.ximai.dto.PurtrCreateParams;
import com.topsunit.scanservice.ximai.entity.*; import com.topsunit.scanservice.ximai.entity.*;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -37,7 +38,7 @@ public class PurtaService { ...@@ -37,7 +38,7 @@ public class PurtaService {
@Transactional @Transactional
public void create(PurtaCreateParams create){ public void create(PurtaCreateParams create){
Mocta mocta = moctaDao.findById(new MoctaId(create.getWorkorderType(), create.getWorkorderCode())) Mocta mocta = moctaDao.findById(new MoctaId(create.getWorkorderType(), create.getWorkorderCode()))
.orElseThrow(()->new TopsunitException(String.format("未找到工单:%s-%s",create.getWorkorderType(), create.getWorkorderCode()))); .orElseThrow(()->new TopsunitException(MessageUtils.getMessage("未找到工单:{0},{1}",create.getWorkorderType(), create.getWorkorderCode())));
Calendar curr = Calendar.getInstance(); Calendar curr = Calendar.getInstance();
String currStr = DateUtil.format(curr.getTime(), "yyyyMMdd"); String currStr = DateUtil.format(curr.getTime(), "yyyyMMdd");
Purta purta = BeanUtil.toBeanIgnoreError(create, Purta.class); Purta purta = BeanUtil.toBeanIgnoreError(create, Purta.class);
......
...@@ -12,6 +12,7 @@ import com.topsunit.scanservice.ximai.dto.PurthCreateParams; ...@@ -12,6 +12,7 @@ import com.topsunit.scanservice.ximai.dto.PurthCreateParams;
import com.topsunit.scanservice.ximai.dto.mapper.PurtgMapper; import com.topsunit.scanservice.ximai.dto.mapper.PurtgMapper;
import com.topsunit.scanservice.ximai.entity.*; import com.topsunit.scanservice.ximai.entity.*;
import com.topsunit.scanservice.ximai.security.CurrentActor; import com.topsunit.scanservice.ximai.security.CurrentActor;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -100,7 +101,7 @@ public class PurtgService { ...@@ -100,7 +101,7 @@ public class PurtgService {
.findById(purtgMapper.toPurccID(purtgCreateParams)) .findById(purtgMapper.toPurccID(purtgCreateParams))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.filter(i -> i.getCc009().trim().equals("Y")) .filter(i -> i.getCc009().trim().equals("Y"))
.orElseThrow(() -> new TopsunitException("到货单不存在或未检验")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("到货单不存在或未检验")));
List<Purcd> purcds = purcdDao.findByCd001AndCd002(purtgCreateParams.getCc001(), purtgCreateParams.getCc002()); // 到货单单身 List<Purcd> purcds = purcdDao.findByCd001AndCd002(purtgCreateParams.getCc001(), purtgCreateParams.getCc002()); // 到货单单身
String currentDate = DateUtil.currentDateString(); String currentDate = DateUtil.currentDateString();
Optional<Purma> purma = purmaDao.findById(purcc.getCc005()); // 供应商 Optional<Purma> purma = purmaDao.findById(purcc.getCc005()); // 供应商
...@@ -195,7 +196,7 @@ public class PurtgService { ...@@ -195,7 +196,7 @@ public class PurtgService {
.forEach(purthCreateParams -> { .forEach(purthCreateParams -> {
cmsniDao.findById(new CmsniId(purthCreateParams.getTh009(), purthCreateParams.getTh072())) cmsniDao.findById(new CmsniId(purthCreateParams.getTh009(), purthCreateParams.getTh072()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("库位不存在")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("库位不存在")));
// 采购单身 // 采购单身
Optional<Purtd> purtd = purtdDao.findById(new PurtdId(localPurcd.getCd010(), localPurcd.getCd011(), localPurcd.getCd012())); Optional<Purtd> purtd = purtdDao.findById(new PurtdId(localPurcd.getCd010(), localPurcd.getCd011(), localPurcd.getCd012()));
...@@ -300,7 +301,7 @@ public class PurtgService { ...@@ -300,7 +301,7 @@ public class PurtgService {
BigDecimal cd020 = localPurcd.getCd020().add(purth.getTh015()); BigDecimal cd020 = localPurcd.getCd020().add(purth.getTh015());
if (cd020.compareTo(localPurcd.getCd018()) > 0) { if (cd020.compareTo(localPurcd.getCd018()) > 0) {
throw new TopsunitException("超出到货单验收数量"); throw new TopsunitException(MessageUtils.getMessage("超出到货单验收数量"));
} }
localPurcd.setCd020(cd020); localPurcd.setCd020(cd020);
purtd.ifPresent(i -> i.setTd015(i.getTd015().add(purth.getTh015()))); purtd.ifPresent(i -> i.setTd015(i.getTd015().add(purth.getTh015())));
......
...@@ -7,6 +7,7 @@ import com.topsunit.scanservice.ximai.dto.*; ...@@ -7,6 +7,7 @@ import com.topsunit.scanservice.ximai.dto.*;
import com.topsunit.scanservice.ximai.dto.mapper.SfctbMapper; import com.topsunit.scanservice.ximai.dto.mapper.SfctbMapper;
import com.topsunit.scanservice.ximai.entity.*; import com.topsunit.scanservice.ximai.entity.*;
import com.topsunit.scanservice.ximai.security.CurrentActor; import com.topsunit.scanservice.ximai.security.CurrentActor;
import com.topsunit.scanservice.ximai.utils.MessageUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -60,23 +61,23 @@ public class SfctbService { ...@@ -60,23 +61,23 @@ public class SfctbService {
String currentDate = DateUtil.currentDateString(); String currentDate = DateUtil.currentDateString();
Mocta mocta = moctaDao.findById(new MoctaId(params.getTc004(), params.getTc005())) Mocta mocta = moctaDao.findById(new MoctaId(params.getTc004(), params.getTc005()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("未找到工单")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到工单")));
Invmb invmb = invmbDao.findById(mocta.getTa006()) Invmb invmb = invmbDao.findById(mocta.getTa006())
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("未找到品号")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到品号")));
Sfcta outSfcta = sfctaDao.findById(new SfctaId(params.getTc004(), params.getTc005(), params.getTc006(), params.getTb005())) Sfcta outSfcta = sfctaDao.findById(new SfctaId(params.getTc004(), params.getTc005(), params.getTc006(), params.getTb005()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("未找到移出工艺")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到移出工艺")));
Sfcta inSfcta = sfctaDao.findById(new SfctaId(params.getTc004(), params.getTc005(), params.getTc008(), params.getTb008())) Sfcta inSfcta = sfctaDao.findById(new SfctaId(params.getTc004(), params.getTc005(), params.getTc008(), params.getTb008()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("未找到移入工艺")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到移入工艺")));
Cmsma cmsma = cmsmaDao.findAll().stream() Cmsma cmsma = cmsmaDao.findAll().stream()
.findFirst() .findFirst()
.orElseThrow(() -> new TopsunitException("未设置共享参数设置挡")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未设置共享参数设置挡")));
Optional<Cmsmg> cmsmg = cmsmgDao.findFirstByMg001OrderByMg002Desc("RMB"); Optional<Cmsmg> cmsmg = cmsmgDao.findFirstByMg001OrderByMg002Desc("RMB");
BigDecimal inProcessQuantity = getInProcessQuantity(outSfcta); BigDecimal inProcessQuantity = getInProcessQuantity(outSfcta);
if (params.getTc036().compareTo(inProcessQuantity) > 0) { if (params.getTc036().compareTo(inProcessQuantity) > 0) {
throw new TopsunitException("转移数量不能超过在制量"); throw new TopsunitException(MessageUtils.getMessage("转移数量不能超过在制量"));
} }
String tc039 = outSfcta.getTa033().trim().equals("0") ? "0" : "1"; String tc039 = outSfcta.getTa033().trim().equals("0") ? "0" : "1";
...@@ -192,25 +193,25 @@ public class SfctbService { ...@@ -192,25 +193,25 @@ public class SfctbService {
String currentDate = DateUtil.currentDateString(); String currentDate = DateUtil.currentDateString();
Mocta mocta = moctaDao.findById(new MoctaId(params.getTc004(), params.getTc005())) Mocta mocta = moctaDao.findById(new MoctaId(params.getTc004(), params.getTc005()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("未找到工单")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到工单")));
Invmb invmb = invmbDao.findById(mocta.getTa006()) Invmb invmb = invmbDao.findById(mocta.getTa006())
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("未找到品号")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到品号")));
Sfcta outSfcta = sfctaDao.findById(new SfctaId(params.getTc004(), params.getTc005(), params.getTc006(), params.getTb005())) Sfcta outSfcta = sfctaDao.findById(new SfctaId(params.getTc004(), params.getTc005(), params.getTc006(), params.getTb005()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("未找到移出工艺")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到移出工艺")));
Cmsmc cmsmc = cmsmcDao.findById(params.getTb008()) Cmsmc cmsmc = cmsmcDao.findById(params.getTb008())
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("仓库不存在")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("仓库不存在")));
cmsniDao.findById(new CmsniId(params.getTb008(), params.getTc056())) cmsniDao.findById(new CmsniId(params.getTb008(), params.getTc056()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.orElseThrow(() -> new TopsunitException("库位不存在")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("库位不存在")));
Cmsma cmsma = cmsmaDao.findAll().stream() Cmsma cmsma = cmsmaDao.findAll().stream()
.findFirst().orElseThrow(() -> new TopsunitException("未设置共享参数设置挡")); .findFirst().orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未设置共享参数设置挡")));
Optional<Cmsmg> cmsmg = cmsmgDao.findFirstByMg001OrderByMg002Desc("RMB"); Optional<Cmsmg> cmsmg = cmsmgDao.findFirstByMg001OrderByMg002Desc("RMB");
BigDecimal inProcessQuantity = getInProcessQuantity(outSfcta); BigDecimal inProcessQuantity = getInProcessQuantity(outSfcta);
if (params.getTc036().compareTo(inProcessQuantity) > 0) { if (params.getTc036().compareTo(inProcessQuantity) > 0) {
throw new TopsunitException("转移数量不能超过在制量"); throw new TopsunitException(MessageUtils.getMessage("转移数量不能超过在制量"));
} }
String tc039 = outSfcta.getTa033().trim().equals("0") ? "0" : "1"; String tc039 = outSfcta.getTa033().trim().equals("0") ? "0" : "1";
...@@ -357,13 +358,13 @@ public class SfctbService { ...@@ -357,13 +358,13 @@ public class SfctbService {
Sfctc sfctc = sfctcDao.findById(new SfctcId(params.getTc001(), params.getTc002(), params.getTc003())) Sfctc sfctc = sfctcDao.findById(new SfctcId(params.getTc001(), params.getTc002(), params.getTc003()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim())) //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.filter(i -> i.getTc022().trim().equals("N")) .filter(i -> i.getTc022().trim().equals("N"))
.orElseThrow(() -> new TopsunitException("此条码已审核,无法检验")); .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("此条码已审核,无法检验")));
if (params.getTc015().compareTo(params.getTc014()) > 0) { if (params.getTc015().compareTo(params.getTc014()) > 0) {
throw new TopsunitException("计价数量不能大于验收数量"); throw new TopsunitException(MessageUtils.getMessage("计价数量不能大于验收数量"));
} }
int finisedFlag = params.getTc014().add(params.getTc016()).add(sfctc.getTc037()).compareTo(sfctc.getTc036()); int finisedFlag = params.getTc014().add(params.getTc016()).add(sfctc.getTc037()).compareTo(sfctc.getTc036());
if (finisedFlag > 0) { if (finisedFlag > 0) {
throw new TopsunitException("验收数量+验退数量+报废数量不能大于转移数量"); throw new TopsunitException(MessageUtils.getMessage("验收数量+验退数量+报废数量不能大于转移数量"));
}else if (finisedFlag == 0){ }else if (finisedFlag == 0){
if(params.getTc014().compareTo(sfctc.getTc036()) >= 0){ if(params.getTc014().compareTo(sfctc.getTc036()) >= 0){
sfctc.setTc039("2"); sfctc.setTc039("2");
......
...@@ -7,26 +7,6 @@ topsunit: ...@@ -7,26 +7,6 @@ topsunit:
mes-url: http://localhost:8088 mes-url: http://localhost:8088
default-password: 123456 default-password: 123456
db-name: demo db-name: demo
print:
urls:
- code: 1
url: http://192.168.1.24:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 2
url: http://192.168.4.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 3
url: http://192.168.2.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 4
url: http://192.168.3.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 5
url: http://192.168.1.25:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 6
url: http://192.168.1.26:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 7
url: http://192.168.2.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 8
url: http://192.168.3.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 9
url: http://192.168.4.197:8085/ximaiprintservice/print/PrintLabelByBarTender
server: server:
port: 20091 port: 20091
servlet: servlet:
...@@ -39,6 +19,9 @@ logging: ...@@ -39,6 +19,9 @@ logging:
web: info web: info
com.topsunit: info com.topsunit: info
spring: spring:
messages:
# 国际化资源文件路径
basename: i18n/messages
devtools: devtools:
restart: restart:
additional-paths: additional-paths:
......
topsunit: topsunit:
token-expires-hour: 8760 token-expires-hour: 8760
token-secret: q8w3Cx9Lr4fT2y6uV5sZ8aE1mN0kP7gH token-secret: q8w3Cx9Lr4fT2y6uV5sZ8aE1mN0kP7gH
authentication-enabled: false authentication-enabled: true
print-api-url: http://127.0.0.1:8085/ximaiprintservice/print/PrintLabelByBarTender print-api-url: http://127.0.0.1:8085/ximaiprintservice/print/PrintLabelByBarTender
share-url: smb://127.0.0.1/share share-url: smb://127.0.0.1/share
mes-url: http://localhost:8088 mes-url: http://localhost:8088
default-password: 123456 default-password: 123456
db-name: TEST db-name: TEST
print:
urls:
- code: 1
url: http://192.168.1.24:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 2
url: http://192.168.4.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 3
url: http://192.168.2.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 4
url: http://192.168.3.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 5
url: http://192.168.1.25:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 6
url: http://192.168.1.26:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 7
url: http://192.168.2.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 8
url: http://192.168.3.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 9
url: http://192.168.4.197:8085/ximaiprintservice/print/PrintLabelByBarTender
server: server:
port: 20091 port: 20091
servlet: servlet:
...@@ -42,14 +22,12 @@ logging: ...@@ -42,14 +22,12 @@ logging:
sql: sql:
Statement: debug Statement: debug
spring: spring:
messages:
# 国际化资源文件路径
basename: i18n/messages
devtools: devtools:
restart: restart:
additional-paths: enabled: false
- src/main/resources
resources:
static-locations:
- classpath:/static/
- classpath:/public/
datasource: datasource:
name: DEMO name: DEMO
username: sa username: sa
......
...@@ -7,26 +7,6 @@ topsunit: ...@@ -7,26 +7,6 @@ topsunit:
mes-url: http://localhost:8088 mes-url: http://localhost:8088
default-password: 123456 default-password: 123456
db-name: TEST db-name: TEST
print:
urls:
- code: 1
url: http://192.168.1.24:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 2
url: http://192.168.4.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 3
url: http://192.168.2.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 4
url: http://192.168.3.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 5
url: http://192.168.1.25:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 6
url: http://192.168.1.26:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 7
url: http://192.168.2.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 8
url: http://192.168.3.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 9
url: http://192.168.4.197:8085/ximaiprintservice/print/PrintLabelByBarTender
server: server:
port: 9094 port: 9094
servlet: servlet:
...@@ -44,6 +24,9 @@ logging: ...@@ -44,6 +24,9 @@ logging:
file: file:
name: logs/erp-service.log name: logs/erp-service.log
spring: spring:
messages:
# 国际化资源文件路径
basename: i18n/messages
devtools: devtools:
restart: restart:
additional-paths: additional-paths:
......
...@@ -7,26 +7,6 @@ topsunit: ...@@ -7,26 +7,6 @@ topsunit:
mes-url: http://192.168.1.128:8088 mes-url: http://192.168.1.128:8088
default-password: 123456 default-password: 123456
db-name: TPYS db-name: TPYS
print:
urls:
- code: 1
url: http://192.168.1.24:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 2
url: http://192.168.4.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 3
url: http://192.168.2.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 4
url: http://192.168.3.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 5
url: http://192.168.1.25:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 6
url: http://192.168.1.26:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 7
url: http://192.168.2.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 8
url: http://192.168.3.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 9
url: http://192.168.4.197:8085/ximaiprintservice/print/PrintLabelByBarTender
server: server:
port: 20091 port: 20091
servlet: servlet:
...@@ -43,6 +23,9 @@ logging: ...@@ -43,6 +23,9 @@ logging:
file: file:
name: logs/erp-service.log name: logs/erp-service.log
spring: spring:
messages:
# 国际化资源文件路径
basename: i18n/messages
devtools: devtools:
restart: restart:
additional-paths: additional-paths:
......
...@@ -7,26 +7,6 @@ topsunit: ...@@ -7,26 +7,6 @@ topsunit:
mes-url: http://localhost:8088 mes-url: http://localhost:8088
default-password: 123456 default-password: 123456
db-name: Leader db-name: Leader
print:
urls:
- code: 1
url: http://192.168.1.24:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 2
url: http://192.168.4.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 3
url: http://192.168.2.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 4
url: http://192.168.3.198:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 5
url: http://192.168.1.25:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 6
url: http://192.168.1.26:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 7
url: http://192.168.2.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 8
url: http://192.168.3.197:8085/ximaiprintservice/print/PrintLabelByBarTender
- code: 9
url: http://192.168.4.197:8085/ximaiprintservice/print/PrintLabelByBarTender
server: server:
port: 20091 port: 20091
servlet: servlet:
...@@ -41,6 +21,9 @@ logging: ...@@ -41,6 +21,9 @@ logging:
file: file:
name: logs/erp-service.log name: logs/erp-service.log
spring: spring:
messages:
# 国际化资源文件路径
basename: i18n/messages
devtools: devtools:
restart: restart:
additional-paths: additional-paths:
......
...@@ -24,4 +24,16 @@ ...@@ -24,4 +24,16 @@
到货单不存在或已检验。=到货单不存在或已检验。 到货单不存在或已检验。=到货单不存在或已检验。
未找到物料:=未找到物料: 未找到物料:=未找到物料:
到货单不存在或未检验=到货单不存在或未检验 到货单不存在或未检验=到货单不存在或未检验
超出到货单验收数量=超出到货单验收数量 超出到货单验收数量=超出到货单验收数量
\ No newline at end of file 未找到对应工单:{0},{1}=未找到对应工单:{0},{1}
未找到对应物料:{0}=未找到对应物料:{0}
未找到对应物料默认库:{0},{1}=未找到对应物料默认库:{0},{1}
未找到出货通知单明细:{0},{1}=未找到出货通知单明细:{0},{1}
找不到材料品号{0},工艺{1}的工单单身。=找不到材料品号{0},工艺{1}的工单单身。
材料品号{0},工艺{1}的领料数量超过可领数量。=材料品号{0},工艺{1}的领料数量超过可领数量。
仓库{0}库位{1}不存在。=仓库{0}库位{1}不存在。
批管理品号{0}必须录入批号。=批管理品号{0}必须录入批号。
品号{0}批号{1}库存不足。=品号{0}批号{1}库存不足。
未找到采购订单{0},{1}=未找到采购订单{0},{1}
未找到采购订单{0},{1},{2}=未找到采购订单{0},{1},{2}
未找到工单:{0},{1}=未找到工单:{0},{1}
\ No newline at end of file
...@@ -24,4 +24,16 @@ ...@@ -24,4 +24,16 @@
到货单不存在或已检验。=the arrival document does not exist or has been inspected. 到货单不存在或已检验。=the arrival document does not exist or has been inspected.
未找到物料:=item not found: 未找到物料:=item not found:
到货单不存在或未检验=the arrival document does not exist or has not been inspected. 到货单不存在或未检验=the arrival document does not exist or has not been inspected.
超出到货单验收数量=exceeding the acceptance quantity of arrival document 超出到货单验收数量=exceeding the acceptance quantity of arrival document
\ No newline at end of file 未找到对应工单:{0},{1}=no corresponding job found: {0},{1}
未找到对应物料:{0}=no corresponding material found: {0}
未找到对应物料默认库:{0},{1}=default library of corresponding material not found: {0},{1}
未找到出货通知单明细:{0},{1}=shipment note details not found: {0},{1}
找不到材料品号{0},工艺{1}的工单单身。=the material item number {0} cannot be found, and the work order of process {1} is single.
材料品号{0},工艺{1}的领料数量超过可领数量。=material item number {0} and process {1} have more picking quantity than available quantity.
仓库{0}库位{1}不存在。=warehouse {0} location {1} does not exist.
批管理品号{0}必须录入批号。=batch number must be entered for batch management product number {0}.
品号{0}批号{1}库存不足。=item {0} lot {1} is out of stock.
未找到采购订单{0},{1}=purchase order {0} not found, {1}
未找到采购订单{0},{1},{2}=purchase orders {0},{1},{2} not found.
未找到工单:{0},{1}=job not found: {0},{1}
\ No newline at end of file
未找到工单=ไม่พบรายการงาน 未找到工单=ไม่พบรายการงาน
未找到品号=ไม่พบหมายเลขผลิตภัณฑ์ 未找到品号=ไม่พบหมายเลขผลิตภัณฑ์
未找到移出工艺=ไม่พบกระบวนการถอดออก 未找到移出工艺=ไม่พบกระบวนการถอดออก
未找到移入工艺=ไม พบกระบวนการย ายเข 未找到移入工艺=ไม่พบกระบวนการย้ายเข้
未设置共享参数设置挡=ไม ได ตั งค าตั งค าพารามิเตอร์ใช วม 未设置共享参数设置挡=ไม่ได้ตั้งค่าตั้งค่าพารามิเตอร์ใช้ร่วม
转移数量不能超过在制量=จํานวนการโอนไม่สามารถเกินมาตรฐานได้ 转移数量不能超过在制量=จํานวนการโอนไม่สามารถเกินมาตรฐานได้
仓库不存在=โกดังไม่มีอยู่ 仓库不存在=โกดังไม่มีอยู่
库位不存在=ไม มีช องเก 库位不存在=ไม่มีช่องเก็
此条码已审核,无法检验=บาร์โค้ดนี้ได้รับการตรวจสอบแล้วและไม่สามารถตรวจสอบได้ 此条码已审核,无法检验=บาร์โค้ดนี้ได้รับการตรวจสอบแล้วและไม่สามารถตรวจสอบได้
计价数量不能大于验收数量=ปริมาณการเรียกเก็บเงินไม่สามารถเกินจํานวนที่ยอมรับได้ 计价数量不能大于验收数量=ปริมาณการเรียกเก็บเงินไม่สามารถเกินจํานวนที่ยอมรับได้
验收数量+验退数量+报废数量不能大于转移数量=จํานวนการยอมรับ+จํานวนการตรวจสอบคืน+จํานวนการทิ้งต้องไม่เกินจํานวนการโอน 验收数量+验退数量+报废数量不能大于转移数量=จํานวนการยอมรับ+จํานวนการตรวจสอบคืน+จํานวนการทิ้งต้องไม่เกินจํานวนการโอน
用户名或密码错误。=ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง 用户名或密码错误。=ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง
未找到登录账套=ไม พบกระเป๋าคุมข อมูลเข าระบบ 未找到登录账套=ไม่พบกระเป๋าคุมข้อมูลเข้าระบบ
用户不存在=ผู้ใช้ไม่มีอยู่ 用户不存在=ผู้ใช้ไม่มีอยู่
原密码输入有误=ป้อนรหัสผ่านเดิมไม่ถูกต้อง 原密码输入有误=ป้อนรหัสผ่านเดิมไม่ถูกต้อง
未找到出货通知单:=ไม่พบใบแจ้งเตือนการจัดส่ง: 未找到出货通知单:=ไม่พบใบแจ้งเตือนการจัดส่ง:
...@@ -24,4 +24,16 @@ ...@@ -24,4 +24,16 @@
到货单不存在或已检验。=ใบเสร็จรับเงินไม่มีอยู่หรือได้รับการตรวจสอบแล้ว 到货单不存在或已检验。=ใบเสร็จรับเงินไม่มีอยู่หรือได้รับการตรวจสอบแล้ว
未找到物料:=ไม่พบวัสดุ: 未找到物料:=ไม่พบวัสดุ:
到货单不存在或未检验=ใบเสร็จรับเงินไม่มีอยู่หรือไม่ได้รับการตรวจสอบ 到货单不存在或未检验=ใบเสร็จรับเงินไม่มีอยู่หรือไม่ได้รับการตรวจสอบ
超出到货单验收数量=เกินจํานวนการยอมรับใบเสร็จรับเงิน 超出到货单验收数量=เกินจํานวนการยอมรับใบเสร็จรับเงิน
\ No newline at end of file 未找到对应工单:{0},{1}=ไม่พบรายการงานที่สอดคล้องกัน:{0},{1}
未找到对应物料:{0}=ไม่พบวัสดุที่สอดคล้องกัน:{0}
未找到对应物料默认库:{0},{1}=ไม่พบไลบรารีปริยายของวัสดุที่สอดคล้องกัน:{0},{1}
未找到出货通知单明细:{0},{1}=ไม่พบรายละเอียดใบแจ้งเตือนการจัดส่ง:{0},{1}
找不到材料品号{0},工艺{1}的工单单身。=ไม่พบวัสดุหมายเลข{0},งานฉบับเดียวสําหรับกระบวนการ{1}
材料品号{0},工艺{1}的领料数量超过可领数量。=หมายเลขวัสดุ{0},จํานวนของกระบวนการ{1}เกินจํานวนที่สามารถรับได้
仓库{0}库位{1}不存在。=คลังสินค้า{0}ที่เก็บ{1}ไม่มีอยู่
批管理品号{0}必须录入批号。=หมายเลขการจัดการแบทช์{0}ต้องป้อนหมายเลขแบทช์
品号{0}批号{1}库存不足。=หมายเลข{0}หมายเลขชุด{1}ไม่เพียงพอ
未找到采购订单{0},{1}=ไม่พบใบสั่งซื้อ{0},{1}
未找到采购订单{0},{1},{2}=ไม่พบใบสั่งซื้อ{0},{1},{2}
未找到工单:{0},{1}=ไม่พบใบสั่งงาน:{0},{1}
\ No newline at end of file
...@@ -24,4 +24,16 @@ ...@@ -24,4 +24,16 @@
到货单不存在或已检验。=到货单不存在或已检验。 到货单不存在或已检验。=到货单不存在或已检验。
未找到物料:=未找到物料: 未找到物料:=未找到物料:
到货单不存在或未检验=到货单不存在或未检验 到货单不存在或未检验=到货单不存在或未检验
超出到货单验收数量=超出到货单验收数量 超出到货单验收数量=超出到货单验收数量
\ No newline at end of file 未找到对应工单:{0},{1}=未找到对应工单:{0},{1}
未找到对应物料:{0}=未找到对应物料:{0}
未找到对应物料默认库:{0},{1}=未找到对应物料默认库:{0},{1}
未找到出货通知单明细:{0},{1}=未找到出货通知单明细:{0},{1}
找不到材料品号{0},工艺{1}的工单单身。=找不到材料品号{0},工艺{1}的工单单身。
材料品号{0},工艺{1}的领料数量超过可领数量。=材料品号{0},工艺{1}的领料数量超过可领数量。
仓库{0}库位{1}不存在。=仓库{0}库位{1}不存在。
批管理品号{0}必须录入批号。=批管理品号{0}必须录入批号。
品号{0}批号{1}库存不足。=品号{0}批号{1}库存不足。
未找到采购订单{0},{1}=未找到采购订单{0},{1}
未找到采购订单{0},{1},{2}=未找到采购订单{0},{1},{2}
未找到工单:{0},{1}=未找到工单:{0},{1}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment