Merge remote-tracking branch 'origin/main'

This commit is contained in:
lihao 2025-05-15 09:32:20 +08:00
commit 1c26c4e2ab
3 changed files with 217 additions and 128 deletions

View File

@ -47,22 +47,20 @@ public class PloProdDeptRule implements IRule<AggregatedPoVO> {
String prodDeptid = plo.getCproddeptid();
String prodDeptvid = plo.getCproddeptvid();
Integer posource = plo.getFposource();
if (PoSourceEnum.COMPUT == posource && MMValueCheck.isEmpty(prodDeptid)
&& MMValueCheck.isEmpty(prodDeptvid) && MMValueCheck.isNotEmpty(stockorgid)
&& MMValueCheck.isNotEmpty(stockorgvid)) {
if (PoSourceEnum.COMPUT == posource && MMValueCheck.isEmpty(prodDeptid) && MMValueCheck.isEmpty(prodDeptvid)
&& MMValueCheck.isNotEmpty(stockorgid) && MMValueCheck.isNotEmpty(stockorgvid)) {
List<String> vids = map.get(stockorgid);
if (null == vids) {
List<String> list = new ArrayList<String>();
list.add(vid);
map.put(stockorgid, list);
}
else {
} else {
vids.add(vid);
}
}
String vsrcbid = plo.getVsrcbid();// À´Ô´µ¥¾Ý±íÌåÖ÷¼ü
int fdemandbill = plo.getFdemandbill();//ÐèÇóÀ´Ô´
if (PoSourceEnum.COMPUT == posource && fdemandbill == 1) {
// 需求来源为备料计划的才回写
if (PoSourceEnum.COMPUT == posource && plo.getFdemandbill() != null && plo.getFdemandbill() == 1) {
vsrcbidList.add(vsrcbid);
}
}
@ -70,8 +68,7 @@ public class PloProdDeptRule implements IRule<AggregatedPoVO> {
String[] vsrcbids = vsrcbidList.toArray(new String[vsrcbidList.size()]);
Map<String, AggPickmVO> pickmVOMap;
try {
pickmVOMap = NCLocator.getInstance().lookup(IPickmPubQueryService.class)
.queryPickm4Issue(vsrcbids);
pickmVOMap = NCLocator.getInstance().lookup(IPickmPubQueryService.class).queryPickm4Issue(vsrcbids);
} catch (BusinessException e) {
throw new RuntimeException(e);
}
@ -103,10 +100,8 @@ public class PloProdDeptRule implements IRule<AggregatedPoVO> {
while (i.hasNext()) {
String key = i.next();
List<String> vids = map.get(key);
Map<String, MaterialProdVO> results =
MaterialPubService.queryMaterialProduceInfoByPks(vids.toArray(new String[0]), key, new String[] {
MaterialProdVO.PK_PRODEPTDOC
});
Map<String, MaterialProdVO> results = MaterialPubService.queryMaterialProduceInfoByPks(
vids.toArray(new String[0]), key, new String[] { MaterialProdVO.PK_PRODEPTDOC });
for (AggregatedPoVO agg : vos) {
PoVO plo = agg.getParentVO();
String vid = plo.getCmaterialvid();
@ -147,8 +142,7 @@ public class PloProdDeptRule implements IRule<AggregatedPoVO> {
}
}
}
}
catch (BusinessException e) {
} catch (BusinessException e) {
ExceptionUtils.wrappException(e);
}

View File

@ -0,0 +1,89 @@
package nc.bs.sscivm.ivsale.util;
import nc.vo.sscivm.ivmpub.InvoiceTypeEnum;
import java.util.HashMap;
import java.util.Map;
/**
* 发票类型和特殊票种映射工具类
* @author wangyl7
*
*/
public class InvoiceTypeToTspzUtil {
private final static Map<Integer,String> invoiceMap = new HashMap<Integer,String>();
private final static Map<Integer,String> tspzMap = new HashMap<Integer,String>();
static {
invoiceMap.put(InvoiceTypeEnum.INVOICETYPE_ZYFP_JDC.toIntValue(), "4");
invoiceMap.put(InvoiceTypeEnum.INVOICETYPE_DZPTFP_KCL.toIntValue(), "1");
invoiceMap.put(InvoiceTypeEnum.INVOICETYPE_DZZYFP_KCL.toIntValue(), "2");
invoiceMap.put(InvoiceTypeEnum.INVOICETYPE_PTFP_KCL.toIntValue(), "3");
invoiceMap.put(InvoiceTypeEnum.INVOICETYPE_ZYFP_KCL.toIntValue(), "4");
invoiceMap.put(InvoiceTypeEnum.INVOICETYPE_ESCTYFP.toIntValue(), "15");//二手车统一销售与机打重复
invoiceMap.put(InvoiceTypeEnum.INVOICETYPE_DZPTFP_NCP.toIntValue(), "1");
invoiceMap.put(InvoiceTypeEnum.INVOICETYPE_PTFP_NCP.toIntValue(), "3");
tspzMap.put(InvoiceTypeEnum.INVOICETYPE_ZYFP_JDC.toIntValue(), "12");
tspzMap.put(InvoiceTypeEnum.INVOICETYPE_DZPTFP_KCL.toIntValue(), "16");
tspzMap.put(InvoiceTypeEnum.INVOICETYPE_DZZYFP_KCL.toIntValue(), "16");
tspzMap.put(InvoiceTypeEnum.INVOICETYPE_PTFP_KCL.toIntValue(), "16");
tspzMap.put(InvoiceTypeEnum.INVOICETYPE_ZYFP_KCL.toIntValue(), "16");
tspzMap.put(InvoiceTypeEnum.INVOICETYPE_DZPTFP_NCP.toIntValue(), "9");
tspzMap.put(InvoiceTypeEnum.INVOICETYPE_PTFP_NCP.toIntValue(), "9");
}
/**
* 获取真实的发票类型
* @param fplx 发票类型
* @return 真实的发票类型
*/
public static String getRealInvoicetype(Integer fplx){
if (invoiceMap.containsKey(fplx)){
return invoiceMap.get(fplx);
}
return String.valueOf(fplx);
}
/**
* 获取特殊票种
* @param fplx 发票类型
* @return 特殊票种
*/
public static String getTspz(Integer fplx){
if (tspzMap.containsKey(fplx)){
return tspzMap.get(fplx);
}
return null;
}
/**
* 更具发票类型和特殊票种转发票类型
* @param fplx
* @param tspz
* @return
*/
public static String getInvoicetypeByFplxAndTspz(String fplx, String tspz){
//非特殊票种
if (tspz == null || tspz.startsWith("E")){
return fplx;
}
//全电发票不拼接
if ("31".equals(fplx) || "32".equals(fplx) ||"33".equals(fplx) || "34".equals(fplx)){
return fplx;
}
//增值税专用发票(机动车)
if ("412".equals(fplx + tspz)){
return InvoiceTypeEnum.INVOICETYPE_ZYFP_JDC.toStringValue();
}
//农产品收购
if ("9".equals(tspz)) {
return fplx + "0" + tspz;
}
//数电纸质发票(机动车销售统一发票
if ("36".equals(fplx)){
return fplx;
}
//其他特殊票种发票
return fplx + tspz;
}
}

View File

@ -88,6 +88,8 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
private static Map<String, Object> tsMap = new HashMap();
private String orgCodeFlag =null;
private static Map<String, Object> voMap = new HashMap();
private static Map<String, Set<String>> idsMap = new HashMap();
@ -112,7 +114,11 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
list.add(agg);
}
AggBomVO[] aggVOs = (AggBomVO[]) list.toArray(new AggBomVO[list.size()]);
if(aggVOs[0].getParentVO().getAttributeValue("pk_org")==null||aggVOs[0].getParentVO().getAttributeValue("pk_org")==""){
ExceptionUtils.wrappBusinessException("请求参数pk_org为空请检查");
}else{
this.orgCodeFlag=aggVOs[0].getParentVO().getAttributeValue("pk_org").toString();
}
BillFieldsCodeToPkUtil.doTranslateVOFields(aggVOs);
IUifService iUifService = NCLocator.getInstance().lookup(IUifService.class);
for (AggBomVO aggtwo : aggVOs) {
@ -170,7 +176,7 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
result = service.insertBom((AggBomVO[]) addAggvoList.toArray(new AggBomVO[0]));
} else if (!commitAggvoList.isEmpty() && addAggvoList.isEmpty()) {
List<AggBomVO> newAggVOList = new ArrayList<>();
if ("gaoning".equals(userCode)) {
if ("gaoning".equals(userCode)|| "C029".equals(orgCodeFlag)) {
for (AggBomVO aggvo : commitAggvoList) {
result = service.insertCommitBomWithParam(new AggBomVO[] { aggvo }, true, true);
newAggVOList.add(result[0]);
@ -720,7 +726,7 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
if (VersionTypeEnum.AVAILABLE.equalsValue(head.getHfversiontype())
&& !head.getCbomid().equals(headvo.getCbomid())) {
// sdlizheng --添加独立判断--plm三方越过此校验
if ("gaoning".equals(userCode) || "dlkgsrm".equals(userCode)) {
if ("gaoning".equals(userCode) || "dlkgsrm".equals(userCode)|| "C029".equals(this.orgCodeFlag)) {
// AggBomVO afterVO = service.canceldefault(aggBomVO);
} else {
return UFBoolean.TRUE;
@ -774,14 +780,14 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
agg.getParent().setAttributeValue("fbillstatus", Integer.valueOf(-1));
agg.getParent().setAttributeValue("hfbomsource", Integer.valueOf(1));
agg.getParent().setAttributeValue("hfbomcategory", Integer.valueOf(1));
if ("gaoning".equals(userCode) || "dlkgsrm".equals(userCode)) {
if ("gaoning".equals(userCode) || "dlkgsrm".equals(userCode)|| "C029".equals(this.orgCodeFlag)) {
// sdlizheng
// 1对于之前不存在的BOM新增时如果是传自由态不默认且无效走标准逻辑如果传的是审批态默认且有效2025年4月11日16点28分 start
if (fbillstatus != null && "1".equals(fbillstatus.toString())) {
agg.getParent().setAttributeValue("hfversiontype", Integer.valueOf(1));
agg.getParent().setAttributeValue("hbdefault", UFBoolean.TRUE);
}else if(fbillstatus != null && "-1".equals(fbillstatus.toString())){
if("gaoning".equals(userCode)){
if("gaoning".equals(userCode)|| "C029".equals(this.orgCodeFlag)){
agg.getParent().setAttributeValue("hfversiontype", Integer.valueOf(1));
agg.getParent().setAttributeValue("hbdefault", UFBoolean.TRUE);
}