patch_dev_ic_材料出库单列表汇总打印_sdlizheng_20250627
This commit is contained in:
parent
8e7e22a451
commit
d093aa5f33
|
@ -0,0 +1,84 @@
|
||||||
|
package nccloud.web.ic.outbound.materialout.action;
|
||||||
|
|
||||||
|
import nc.itf.scmpub.reference.uap.bd.currency.CurrencyInfo;
|
||||||
|
import nc.vo.ic.general.define.ICBillVO;
|
||||||
|
import nc.vo.ml.NCLangRes4VoTransl;
|
||||||
|
import nc.vo.scmpub.res.billtype.ICBillType;
|
||||||
|
import nc.vo.scmpub.util.BillBodySortUtils;
|
||||||
|
import nccloud.commons.lang.StringUtils;
|
||||||
|
import nccloud.dto.ic.pub.entity.BillVOWithExtendInfo;
|
||||||
|
import nccloud.framework.core.json.IJson;
|
||||||
|
import nccloud.framework.service.ServiceLocator;
|
||||||
|
import nccloud.framework.web.action.itf.ICommonAction;
|
||||||
|
import nccloud.framework.web.container.IRequest;
|
||||||
|
import nccloud.framework.web.json.JsonFactory;
|
||||||
|
import nccloud.framework.web.ui.model.row.Cell;
|
||||||
|
import nccloud.framework.web.ui.pattern.billcard.BillCard;
|
||||||
|
import nccloud.pubitf.ic.pub.service.IICBillVOQueryService;
|
||||||
|
import nccloud.web.ic.pub.precision.ICBaseBillcardPrecisionHandler;
|
||||||
|
import nccloud.web.ic.pub.utils.DealDisplayIsNullUtil;
|
||||||
|
import nccloud.web.ic.ui.pattern.billcard.ICBillCardOperator;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Classname QueryMaterialOutCardInfoAction
|
||||||
|
* @Description TODO
|
||||||
|
* @Version 1.0.0
|
||||||
|
* @Date 2025/6/25 16:48
|
||||||
|
* @Created by ame
|
||||||
|
*/
|
||||||
|
public class QueryMaterialOutCardInfoAction implements ICommonAction {
|
||||||
|
@Override
|
||||||
|
public Object doAction(IRequest request) {
|
||||||
|
String read = request.read();
|
||||||
|
IJson json = JsonFactory.create();
|
||||||
|
Map<String,Object> info = json.fromJson(read, Map.class);
|
||||||
|
List<String> pks = (List<String>) info.get("pks");
|
||||||
|
String pageid = (String) info.get("pageid");
|
||||||
|
String pagecodechi = (String) info.get("pagecodechi");
|
||||||
|
Map<String,Object> retmap = new HashMap();
|
||||||
|
BillVOWithExtendInfo[] billVOWithExtendInfos = ((IICBillVOQueryService) ServiceLocator.find(IICBillVOQueryService.class)).queryBillDev(ICBillType.MaterialOut, pks.toArray(new String[0]));
|
||||||
|
if(billVOWithExtendInfos!=null && billVOWithExtendInfos.length>0){
|
||||||
|
List<BillCard> billCardList=new ArrayList<>();
|
||||||
|
for(BillVOWithExtendInfo extendInfo : billVOWithExtendInfos){
|
||||||
|
BillBodySortUtils.sort(new ICBillVO[]{extendInfo.getBillvo()});
|
||||||
|
BillCard retcard = this.afterProcess(pagecodechi, pageid, extendInfo.getBillvo());
|
||||||
|
billCardList.add(retcard);
|
||||||
|
// retmap.put("isLocationManaged", extendInfo.isLocationManaged());
|
||||||
|
// retmap.put("materialSerialMap", extendInfo.getMaterialSerialMap());
|
||||||
|
// retmap.put("materialSnunitMap", extendInfo.getMaterialSnunitMap());
|
||||||
|
}
|
||||||
|
|
||||||
|
retmap.put("billcard", billCardList);
|
||||||
|
return retmap;
|
||||||
|
}else{
|
||||||
|
throw new RuntimeException(NCLangRes4VoTransl.getNCLangRes().getStrByID("4008027_0", "04008027-0180"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public BillCard afterProcess(String pagecodechi, String pageid, ICBillVO vo) {
|
||||||
|
ICBillCardOperator operator = new ICBillCardOperator((String)null, pageid, pagecodechi);
|
||||||
|
BillCard retcard = operator.toCard(vo);
|
||||||
|
String ccurrencyid = (String)vo.getBody(0).getAttributeValue("ccurrencyid");
|
||||||
|
if (!StringUtils.isEmpty(ccurrencyid)) {
|
||||||
|
String name = CurrencyInfo.getName(ccurrencyid);
|
||||||
|
retcard.getBody().getModel().getListRows().forEach((row) -> {
|
||||||
|
Cell cell = new Cell();
|
||||||
|
cell.setValue(ccurrencyid);
|
||||||
|
cell.setDisplay(name);
|
||||||
|
row.addCell("ccurrencyid", cell);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ICBaseBillcardPrecisionHandler handler = this.getPrecisionHandler(retcard);
|
||||||
|
handler.process();
|
||||||
|
DealDisplayIsNullUtil.dealBillCardDisPlayIsNull(new String[]{"ccorrespondcode", "vexigencycode"}, retcard);
|
||||||
|
return retcard;
|
||||||
|
}
|
||||||
|
protected ICBaseBillcardPrecisionHandler getPrecisionHandler(BillCard card) {
|
||||||
|
return new ICBaseBillcardPrecisionHandler(card);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,100 @@
|
||||||
|
package nccloud.web.ic.pub.action;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import nc.vo.ic.general.define.ICBillVO;
|
||||||
|
import nc.vo.pubapp.res.NCModule;
|
||||||
|
import nccloud.base.reflect.NCClass;
|
||||||
|
import nccloud.dto.ic.pub.entity.GeneralSumPrintInfo;
|
||||||
|
import nccloud.framework.core.io.WebFileType;
|
||||||
|
import nccloud.framework.core.json.IJson;
|
||||||
|
import nccloud.framework.web.container.SessionContext;
|
||||||
|
import nccloud.framework.web.json.JsonFactory;
|
||||||
|
import nccloud.framework.web.processor.template.BillCardConvertProcessor;
|
||||||
|
import nccloud.framework.web.processor.template.ExtBillCardConvertProcessor;
|
||||||
|
import nccloud.framework.web.ui.pattern.billcard.BillCard;
|
||||||
|
import nccloud.framework.web.ui.pattern.extbillcard.ExtBillCard;
|
||||||
|
import nccloud.pubitf.platform.print.IPrintInfo;
|
||||||
|
import nccloud.pubitf.platform.print.vo.BatchPrintInfo;
|
||||||
|
import nccloud.web.platform.print.AbstractPrintAction;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description ³öÈë¿â»ã×Ü´òÓ¡
|
||||||
|
* @author zhegnxinm
|
||||||
|
* @date 2018-12-16 ÉÏÎç10:48:39
|
||||||
|
* @version ncc1.0
|
||||||
|
*/
|
||||||
|
public class GeneralSumPrintAction extends AbstractPrintAction {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPrintInfo convertPrintInfo(BatchPrintInfo info) {
|
||||||
|
IJson json = JsonFactory.create();
|
||||||
|
GeneralSumPrintInfo newinfo = json.fromJson(info.getUserjson(), GeneralSumPrintInfo.class);
|
||||||
|
newinfo.setFilename((info.getFilename() == null) ? "download-"
|
||||||
|
+ String.valueOf(System.currentTimeMillis()) : info
|
||||||
|
.getFilename());
|
||||||
|
|
||||||
|
String appcode = info.getAppcode();
|
||||||
|
String billcardStr = newinfo.getBillcard();
|
||||||
|
|
||||||
|
if (appcode == null) {
|
||||||
|
appcode = SessionContext.getInstance().getAppcode();
|
||||||
|
}
|
||||||
|
ICBillVO bill = null;
|
||||||
|
if(appcode.equals("400800800")){
|
||||||
|
ExtBillCard billcard = json.fromJson(billcardStr, ExtBillCard.class);
|
||||||
|
ExtBillCardConvertProcessor processor = new ExtBillCardConvertProcessor();
|
||||||
|
bill = processor.fromExtBillCard(billcard);
|
||||||
|
}else if("400801214".equals(appcode)){
|
||||||
|
BillCard[] billcardList = json.fromJson(billcardStr,BillCard[].class);
|
||||||
|
BillCardConvertProcessor processor = new BillCardConvertProcessor();
|
||||||
|
List<ICBillVO> billVOList=new ArrayList<>();
|
||||||
|
newinfo.setAppcode(appcode);
|
||||||
|
newinfo.setIds(info.getOids());
|
||||||
|
newinfo.setNodeKey(info.getNodekey());
|
||||||
|
NCClass printServiceClazz = new NCClass();
|
||||||
|
printServiceClazz.setModule(getPrintServiceModule());
|
||||||
|
printServiceClazz.setName(getPrintServiceName());
|
||||||
|
newinfo.setPrintServiceClazz(printServiceClazz);
|
||||||
|
newinfo.setPrintTemplateID(info.getPrintTemplateID());
|
||||||
|
for(BillCard billcard:billcardList ){
|
||||||
|
bill = processor.fromBillCard(billcard);
|
||||||
|
billVOList.add(bill);
|
||||||
|
}
|
||||||
|
newinfo.setData(billVOList.toArray(new Object[0]));
|
||||||
|
return newinfo;
|
||||||
|
}else{
|
||||||
|
BillCard billcard = json.fromJson(billcardStr,BillCard.class);
|
||||||
|
BillCardConvertProcessor processor = new BillCardConvertProcessor();
|
||||||
|
bill = processor.fromBillCard(billcard);
|
||||||
|
}
|
||||||
|
newinfo.setAppcode(appcode);
|
||||||
|
newinfo.setIds(info.getOids());
|
||||||
|
newinfo.setNodeKey(info.getNodekey());
|
||||||
|
NCClass printServiceClazz = new NCClass();
|
||||||
|
printServiceClazz.setModule(getPrintServiceModule());
|
||||||
|
printServiceClazz.setName(getPrintServiceName());
|
||||||
|
newinfo.setPrintServiceClazz(printServiceClazz);
|
||||||
|
newinfo.setPrintTemplateID(info.getPrintTemplateID());
|
||||||
|
newinfo.setData(new Object[] { bill });
|
||||||
|
return newinfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getPrintServiceModule() {
|
||||||
|
return NCModule.IC.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrintServiceName() {
|
||||||
|
return "nccloud.pubimpl.ic.inbound.generalin.operator.GeneralSumPrintOperator";
|
||||||
|
}
|
||||||
|
|
||||||
|
public WebFileType getWebFileType() {
|
||||||
|
return WebFileType.Pdf;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,173 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<actions>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.query</name>
|
||||||
|
<label>材料出库查询</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.queryPage</name>
|
||||||
|
<label>材料出库分页信息查询</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutPageQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.maintain</name>
|
||||||
|
<label>材料出库删除</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutMaintainAction</clazz>
|
||||||
|
<btncode>Delete,UnSign,Sign</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.save</name>
|
||||||
|
<label>材料出库单保存</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutSaveAction</clazz>
|
||||||
|
<btncode>Save</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.canbecopy</name>
|
||||||
|
<label>材料出库单查询是否可以复制</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutBeforeCopyAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.copy</name>
|
||||||
|
<label>材料出库单复制</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutCopyAction</clazz>
|
||||||
|
<btncode>Copy</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.importSrcBillSN</name>
|
||||||
|
<label>材料出库单导入来源单据序列号</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutImportSrcSNAction</clazz>
|
||||||
|
<btncode>ImportSrcBillSN</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.cardquery</name>
|
||||||
|
<label>材料出库卡片态查询</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutQueryCardAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.query422x</name>
|
||||||
|
<label>材料出库拉单查询物资需求申请单</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.Query422xFor4DAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.query4B36</name>
|
||||||
|
<label>材料出库拉单查询维修工单</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.Query4B36For4DAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.query4455</name>
|
||||||
|
<label>材料出库拉单查询出库申请单</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.Query4455For4DAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.queryall</name>
|
||||||
|
<label>材料出库拉单查询所有</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.QueryAllFor4DAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.transfervo</name>
|
||||||
|
<label>材料出库转单</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.TransToMaterialOutAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.pickauto</name>
|
||||||
|
<label>材料出库自动拣货</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutPickAutoAction</clazz>
|
||||||
|
<btncode>PickAuto</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.print</name>
|
||||||
|
<label>材料出库打印</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutPrintAction</clazz>
|
||||||
|
<btncode>Print,output,Print_list</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.printloc</name>
|
||||||
|
<label>材料出库打印货位</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutPrintLocAction</clazz>
|
||||||
|
<btncode>PrintLoc</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.combine</name>
|
||||||
|
<label>材料出库合并显示</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutCombineAction</clazz>
|
||||||
|
<btncode>CombinePrint</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.checkprem</name>
|
||||||
|
<label>材料出库修改、打印校验权限</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutDataPermissionAction</clazz>
|
||||||
|
<btncode>Edit,Print</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.headAfterEdit</name>
|
||||||
|
<label>材料出库表头区域改变事件</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.events.MaterialOutHeadAfterEventAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.bodyAfterEdit</name>
|
||||||
|
<label>材料出库表体区域改变事件</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.events.MaterialOutBodyAfterEditAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.locationquery</name>
|
||||||
|
<label>材料出库单货位序列号查询</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutLocationQueryAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.queryMMbill</name>
|
||||||
|
<label>材料出库单货位序列号查询</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.QueryMMbillAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.generateCard</name>
|
||||||
|
<label>材料出库单生成设备卡片(取消生成)</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutGenerateEquipCardAction</clazz>
|
||||||
|
<btncode>Generate4A00,Cancel4A00</btncode>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.frominvcount</name>
|
||||||
|
<label>盘点跳转材料出-转数据</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutFromInvcountAdjustAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.frompurchasein</name>
|
||||||
|
<label>采购入库跳转材料出-转数据</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.PurchaseIn2MaterialOutAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.dealratio</name>
|
||||||
|
<label>材料出库单-配比出库处理数据(弹框内)</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutDealRatioDataAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.delRowCheck</name>
|
||||||
|
<label>材料出库卡片删行校验</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutDelRowCheckAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.generalout.query4A</name>
|
||||||
|
<label>参照入库单生单查询</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.Query4A60for4DAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.generatehj</name>
|
||||||
|
<label>材料出库卡片生成转固单</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutFixedAssetAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.delMaterialOutAssetbill</name>
|
||||||
|
<label>材料出库卡片取消生成转固单</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.MaterialOutDelFixedAssetAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.onhandOut</name>
|
||||||
|
<label>存量出库生成材料出库单</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.OnhandToMaterialOutAction</clazz>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<name>ic.materialout.queryCardByPKs</name>
|
||||||
|
<label>根据主键查询卡片信息</label>
|
||||||
|
<clazz>nccloud.web.ic.outbound.materialout.action.QueryMaterialOutCardInfoAction</clazz>
|
||||||
|
</action>
|
||||||
|
</actions>
|
|
@ -0,0 +1,46 @@
|
||||||
|
<authorizes>
|
||||||
|
<authorize>
|
||||||
|
<appcode>400801214,400802200</appcode>
|
||||||
|
<actions>
|
||||||
|
<action>ic.materialout.query</action>
|
||||||
|
<action>ic.materialout.queryPage</action>
|
||||||
|
<action>ic.saleout.queryAddBtn</action>
|
||||||
|
<action>ic.materialout.maintain</action>
|
||||||
|
<action>ic.materialout.save</action>
|
||||||
|
<action>ic.materialout.canbecopy</action>
|
||||||
|
<action>ic.materialout.copy</action>
|
||||||
|
<action>ic.materialout.importSrcBillSN</action>
|
||||||
|
<action>ic.materialout.cardquery</action>
|
||||||
|
<action>ic.materialout.query422x</action>
|
||||||
|
<action>ic.materialout.query4455</action>
|
||||||
|
<action>ic.materialout.query4B36</action>
|
||||||
|
<action>ic.materialout.queryall</action>
|
||||||
|
<action>ic.generalout.queryin</action>
|
||||||
|
<action>ic.materialout.transfervo</action>
|
||||||
|
<action>ic.materialout.pickauto</action>
|
||||||
|
<action>ic.materialout.print</action>
|
||||||
|
<action>ic.materialout.printloc</action>
|
||||||
|
<action>ic.materialout.combine</action>
|
||||||
|
<action>ic.materialout.checkprem</action>
|
||||||
|
<action>ic.materialout.headAfterEdit</action>
|
||||||
|
<action>ic.materialout.bodyAfterEdit</action>
|
||||||
|
<action>ic.materialout.locationquery</action>
|
||||||
|
<action>ic.materialout.queryMMbill</action>
|
||||||
|
<action>ic.materialout.generateCard</action>
|
||||||
|
<action>ic.materialout.frominvcount</action>
|
||||||
|
<action>ic.materialout.frompurchasein</action>
|
||||||
|
<action>ic.materialout.dealratio</action>
|
||||||
|
<action>ic.materialout.delRowCheck</action>
|
||||||
|
<action>ic.materialout.generatehj</action>
|
||||||
|
<action>ic.materialout.delMaterialOutAssetbill</action>
|
||||||
|
<action>ic.materialout.onhandOut</action>
|
||||||
|
<action>ic.materialout.queryCardByPKs</action>
|
||||||
|
</actions>
|
||||||
|
</authorize>
|
||||||
|
<authorize>
|
||||||
|
<appcode>400802000,400802004,400800808,400800816</appcode>
|
||||||
|
<actions>
|
||||||
|
<action>ic.materialout.queryMMbill</action>
|
||||||
|
</actions>
|
||||||
|
</authorize>
|
||||||
|
</authorizes>
|
|
@ -0,0 +1,196 @@
|
||||||
|
package nccloud.pubimpl.ic.pub.service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import nc.bs.framework.common.NCLocator;
|
||||||
|
import nc.bs.ic.pub.util.ICBillVOQuery;
|
||||||
|
import nc.impl.pubapp.pattern.data.vo.VOQuery;
|
||||||
|
import nc.pubitf.uapbd.CurrencyRateUtilHelper;
|
||||||
|
import nc.vo.ic.general.define.ICBillBodyVO;
|
||||||
|
import nc.vo.ic.general.define.ICBillFlag;
|
||||||
|
import nc.vo.ic.general.define.ICBillHeadVO;
|
||||||
|
import nc.vo.ic.general.define.ICBillVO;
|
||||||
|
import nc.vo.ic.general.define.MetaNameConst;
|
||||||
|
import nc.vo.ic.general.util.ICLocationUtil;
|
||||||
|
import nc.vo.ic.m45.entity.PurchaseInVO;
|
||||||
|
import nc.vo.ic.org.OrgInfoQuery;
|
||||||
|
import nc.vo.ic.transtype.TransTypeExtendVO;
|
||||||
|
import nc.vo.pub.ISuperVO;
|
||||||
|
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
||||||
|
import nc.vo.scmpub.res.billtype.ICBillType;
|
||||||
|
import nc.vo.scmpub.util.BillBodySortUtils;
|
||||||
|
import nc.vo.ic.m45.utils.BillQuery;
|
||||||
|
import nccloud.dto.ic.pub.entity.BillVOWithExtendInfo;
|
||||||
|
import nccloud.dto.ic.pub.entity.ICBillstatusForWeb;
|
||||||
|
import nccloud.pubimpl.ic.pub.utils.ICBillExtendInfoHelper;
|
||||||
|
import nccloud.pubitf.ic.pub.service.IICBillVOQueryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存单据查询实现类
|
||||||
|
*
|
||||||
|
* @author hujieh
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ICBillVOQueryServiceImpl implements IICBillVOQueryService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ICBillVO[] query(ICBillType billtype, String[] hids) {
|
||||||
|
ICBillVO[] vos = new ICBillVOQuery(billtype).query(hids);
|
||||||
|
if(billtype.equals(ICBillType.PurchaseIn)){
|
||||||
|
try {
|
||||||
|
vos = new BillQuery<PurchaseInVO>(PurchaseInVO.class).queryGrandsons((PurchaseInVO[]) vos);
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionUtils.wrappException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return vos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public ICBillHeadVO[] query(Class<?> T, String[] hids) {
|
||||||
|
return (ICBillHeadVO[]) new VOQuery(T).query(hids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BillVOWithExtendInfo queryBillExtByVO(ICBillVO vo) {
|
||||||
|
BillVOWithExtendInfo info = new ICBillExtendInfoHelper()
|
||||||
|
.getExtendInfoByBillVO(vo);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BillVOWithExtendInfo queryBillExt(ICBillType billtype, String hid) {
|
||||||
|
ICBillVO[] vos = new ICBillVOQuery(billtype).query(new String[] { hid });
|
||||||
|
if(billtype.equals(ICBillType.PurchaseIn)){
|
||||||
|
try {
|
||||||
|
vos = new BillQuery<PurchaseInVO>(PurchaseInVO.class).queryGrandsons((PurchaseInVO[]) vos);
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionUtils.wrappException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (billtype.equals(ICBillType.LocAdjust)) {
|
||||||
|
vos = ICLocationUtil.loadLocationVOsFilterNeg(vos);
|
||||||
|
} else {
|
||||||
|
vos = ICLocationUtil.loadLocationVOs(vos);
|
||||||
|
}
|
||||||
|
if (vos != null && vos.length == 1) {
|
||||||
|
BillBodySortUtils.sort(vos);
|
||||||
|
// 本位币
|
||||||
|
String cfinanceoid = new OrgInfoQuery().getFinanceOrgIDByCalBodyID(vos[0].getHead().getPk_org());
|
||||||
|
String ccurrencyid = CurrencyRateUtilHelper.getInstance().getLocalCurrtypeByOrgID(cfinanceoid);
|
||||||
|
Arrays.asList(vos[0].getBodys()).stream().forEach(body -> {body.setAttributeValue(MetaNameConst.CCURRENCYID, ccurrencyid);});
|
||||||
|
BillVOWithExtendInfo info = new ICBillExtendInfoHelper()
|
||||||
|
.getExtendInfoByBillVO(vos[0]);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BillVOWithExtendInfo[] queryBillDev(ICBillType billtype, String[] hids) {
|
||||||
|
ICBillVO[] vos = new ICBillVOQuery(billtype).query(hids);
|
||||||
|
if(billtype.equals(ICBillType.PurchaseIn)){
|
||||||
|
try {
|
||||||
|
vos = new BillQuery<PurchaseInVO>(PurchaseInVO.class).queryGrandsons((PurchaseInVO[]) vos);
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionUtils.wrappException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (billtype.equals(ICBillType.LocAdjust)) {
|
||||||
|
vos = ICLocationUtil.loadLocationVOsFilterNeg(vos);
|
||||||
|
} else {
|
||||||
|
vos = ICLocationUtil.loadLocationVOs(vos);
|
||||||
|
}
|
||||||
|
List<BillVOWithExtendInfo> resultList=new ArrayList<>();
|
||||||
|
if (vos != null && vos.length >0) {
|
||||||
|
BillBodySortUtils.sort(vos);
|
||||||
|
|
||||||
|
for(ICBillVO vo:vos){
|
||||||
|
// 本位币
|
||||||
|
String cfinanceoid = new OrgInfoQuery().getFinanceOrgIDByCalBodyID(vo.getHead().getPk_org());
|
||||||
|
String ccurrencyid = CurrencyRateUtilHelper.getInstance().getLocalCurrtypeByOrgID(cfinanceoid);
|
||||||
|
Arrays.asList(vo.getBodys()).stream().forEach(body -> {body.setAttributeValue(MetaNameConst.CCURRENCYID, ccurrencyid);});
|
||||||
|
BillVOWithExtendInfo info = new ICBillExtendInfoHelper()
|
||||||
|
.getExtendInfoByBillVO(vo);
|
||||||
|
resultList.add(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultList.toArray(new BillVOWithExtendInfo[resultList.size()]);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public TransTypeExtendVO qryTransTypeExtendVOByPK(String pk) {
|
||||||
|
TransTypeExtendVO[] retvo = (TransTypeExtendVO[]) new VOQuery(
|
||||||
|
TransTypeExtendVO.class).queryWithWhereKeyWord(
|
||||||
|
" where CTRANTYPEID= '" + pk + "'", "");
|
||||||
|
return retvo[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ICBillHeadVO[] queryHeadWithInfo(ICBillType billtype,
|
||||||
|
ISuperVO[] headvos) {
|
||||||
|
ICBillVO[] billvos = queryBillByHead(billtype, headvos);
|
||||||
|
if (billvos == null || billvos.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return filterHeadVO(billvos);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ICBillHeadVO[] filterHeadVO(ICBillVO[] billvos) {
|
||||||
|
List<ICBillHeadVO> headvos = new ArrayList<ICBillHeadVO>();
|
||||||
|
for (ICBillVO billvo : billvos) {
|
||||||
|
ICBillHeadVO head = billvo.getHead();
|
||||||
|
// 处理中和待签字的单据都是自由态
|
||||||
|
if (head.getFbillflag() == ICBillFlag.getFreeFlag()) {
|
||||||
|
boolean isProcessing = false;
|
||||||
|
ICBillBodyVO[] bodys = billvo.getBodys();
|
||||||
|
// 存在一行表体没有实收或实发的单据认为是处理中
|
||||||
|
// 数量为0认为是有数量
|
||||||
|
for (ICBillBodyVO body : bodys) {
|
||||||
|
if (null == body.getNnum()) {
|
||||||
|
isProcessing = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 不是处理中的单据认为是待签字
|
||||||
|
if (!isProcessing) {
|
||||||
|
head.setAttributeValue(ICBillstatusForWeb.ICBILLSTATUS,
|
||||||
|
ICBillstatusForWeb.TOSIGN);
|
||||||
|
} else {
|
||||||
|
head.setAttributeValue(ICBillstatusForWeb.ICBILLSTATUS,
|
||||||
|
ICBillstatusForWeb.TOPROCESS);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
head.setAttributeValue(ICBillstatusForWeb.ICBILLSTATUS,
|
||||||
|
ICBillstatusForWeb.SIGNED);
|
||||||
|
}
|
||||||
|
headvos.add(head);
|
||||||
|
}
|
||||||
|
return headvos.toArray(new ICBillHeadVO[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ICBillVO[] queryBillByHead(ICBillType billtype, ISuperVO[] headvos) {
|
||||||
|
Set<String> ids = new HashSet<String>();
|
||||||
|
for (ISuperVO headvo : headvos) {
|
||||||
|
ids.add((String) headvo
|
||||||
|
.getAttributeValue(MetaNameConst.CGENERALHID));
|
||||||
|
}
|
||||||
|
ICBillVO[] billvos = NCLocator.getInstance()
|
||||||
|
.lookup(IICBillVOQueryService.class)
|
||||||
|
.query(billtype, ids.toArray(new String[0]));
|
||||||
|
return billvos;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public TransTypeExtendVO qryTransTypeExtendVOByPK(String pk) {
|
||||||
|
// TransTypeExtendVO[] retvo = (TransTypeExtendVO[]) new VOQuery(
|
||||||
|
// TransTypeExtendVO.class).queryWithWhereKeyWord(" where pk_group ="
|
||||||
|
// + "'" + InvocationInfoProxy.getInstance().getGroupId() + "'"
|
||||||
|
// + " and transtypecode = " + "'" + pk + "'", null);
|
||||||
|
// return retvo[0];
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package nccloud.pubitf.ic.pub.service;
|
||||||
|
|
||||||
|
import nc.vo.ic.general.define.ICBillHeadVO;
|
||||||
|
import nc.vo.ic.general.define.ICBillVO;
|
||||||
|
import nc.vo.ic.transtype.TransTypeExtendVO;
|
||||||
|
import nc.vo.pub.ISuperVO;
|
||||||
|
import nc.vo.scmpub.res.billtype.ICBillType;
|
||||||
|
import nccloud.dto.ic.pub.entity.BillVOWithExtendInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存单据查询接口
|
||||||
|
* @author hujieh
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IICBillVOQueryService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父类主键,查询聚合VO
|
||||||
|
* @param hids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ICBillVO[] query(ICBillType billtype, String[] hids);
|
||||||
|
/**
|
||||||
|
* 根据主键查询表头信息
|
||||||
|
* @param T
|
||||||
|
* @param hids
|
||||||
|
* @return
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public ICBillHeadVO[] query(Class<?> T,String[] hids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存单据,并且包含扩展信息
|
||||||
|
* @param billtype
|
||||||
|
* @param hid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public BillVOWithExtendInfo queryBillExt(ICBillType billtype, String hid);
|
||||||
|
public BillVOWithExtendInfo[] queryBillDev(ICBillType billtype, String[] hids);
|
||||||
|
/**
|
||||||
|
*查询交易类型扩展属性vo
|
||||||
|
* @param pk
|
||||||
|
* @return
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public TransTypeExtendVO qryTransTypeExtendVOByPK(String pk);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存出入库单据根据表头vo,补充toSign(是否可以签字)标志并返回
|
||||||
|
* @param headvos
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ICBillHeadVO[] queryHeadWithInfo(ICBillType billtype, ISuperVO[] headvos);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存单据,并且包含扩展信息
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public BillVOWithExtendInfo queryBillExtByVO(ICBillVO vo);
|
||||||
|
}
|
Loading…
Reference in New Issue