|
@@ -54,6 +54,9 @@ public class HrLaborcostcopyPlugin implements IBackgroundWorkPlugin {
|
|
|
String pk_group = "0001A110000000000LO7";
|
|
|
|
|
|
public PreAlertObject executeTask(BgWorkingContext bgwc) throws BusinessException {
|
|
|
+ NcLog.info("HrLaborcostcopyPlugin定时任务开始执行");
|
|
|
+ System.out.println("HrLaborcostcopyPlugin定时任务开始执行");
|
|
|
+
|
|
|
InvocationInfoProxy.getInstance().setGroupId(pk_group);
|
|
|
|
|
|
Map<String, String> pndocIDMap = null;
|
|
@@ -70,9 +73,13 @@ public class HrLaborcostcopyPlugin implements IBackgroundWorkPlugin {
|
|
|
Map<String, String> pk_suppliermap = null;
|
|
|
Map<String, String> orgnamemap = null;
|
|
|
Map<String, List<String>> mapsl = null;
|
|
|
+ //2025-03-28
|
|
|
+ Map<String, String> outlaytypeMemoMap = null;
|
|
|
try {
|
|
|
pndocIDMap = getPsndocID();// 人员主键
|
|
|
outlaytypeIDMap = getOutlaytypeID();// 费用归属类别id
|
|
|
+ //2025-03-28
|
|
|
+ outlaytypeMemoMap = getOutlaytypeMemo();// 费用归属类别备注
|
|
|
xzsxIDMap = getXzsxID();// 薪资事项id
|
|
|
islssuedIDMap = getIslssuedID();// 是否代发id
|
|
|
ispaymentIDMap = getIspaymentID();// 是否代收付id
|
|
@@ -127,7 +134,8 @@ public class HrLaborcostcopyPlugin implements IBackgroundWorkPlugin {
|
|
|
}
|
|
|
} else {
|
|
|
try {
|
|
|
- listCostMap1 = getLaborost1(date);// 人力成本备份数据
|
|
|
+ listCostMap2 = getLaborost1(date);// 人力成本备份数据
|
|
|
+ listCostMap1=getNewListCostMap(listCostMap2,mapsl,orgnamemap);
|
|
|
} catch (Exception e) {
|
|
|
e.getStackTrace();
|
|
|
NcLog.info("定时传日期查询人力成本备份数据异常" + e.getMessage());
|
|
@@ -135,18 +143,34 @@ public class HrLaborcostcopyPlugin implements IBackgroundWorkPlugin {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<String> orglist = new ArrayList<String>();
|
|
|
+ //List<String> orglist = new ArrayList<String>();
|
|
|
+
|
|
|
+
|
|
|
+// for (Map<String, String> map : listCostMap1) {
|
|
|
+// String wa_org = map.get("wa_org");
|
|
|
+// if (wa_org != null && !"null".equals(wa_org) ) {
|
|
|
+// if (!orglist.contains(wa_org))
|
|
|
+// orglist.add(wa_org);
|
|
|
+// }
|
|
|
+// }
|
|
|
+ //start 2025-03-25
|
|
|
+ List<String> wa_costorglist = new ArrayList<String>();
|
|
|
for (Map<String, String> map : listCostMap1) {
|
|
|
String wa_org = map.get("wa_org");
|
|
|
- if (wa_org != null && !"null".equals(wa_org) ) {
|
|
|
- if (!orglist.contains(wa_org))
|
|
|
- orglist.add(wa_org);
|
|
|
+ String cost_org = map.get("cost_org");
|
|
|
+ String wa_costorg=wa_org+","+cost_org;
|
|
|
+
|
|
|
+ if (wa_org != null && !"null".equals(wa_org)&&cost_org != null && !"null".equals(cost_org) ) {
|
|
|
+ if (!wa_costorglist.contains(wa_costorg))
|
|
|
+ wa_costorglist.add(wa_costorg);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- for (int j = 0; j < orglist.size(); j++) {
|
|
|
+ for (int j = 0; j < wa_costorglist.size(); j++) {
|
|
|
try {
|
|
|
- String waorg = orglist.get(j);
|
|
|
+ String wa_costorg= wa_costorglist.get(j);
|
|
|
+ String waorg = wa_costorg.split(",")[0];
|
|
|
+ String costorg = wa_costorg.split(",")[1];
|
|
|
+ //end 2025-03-25
|
|
|
UFDouble debitamounttotal = new UFDouble();
|
|
|
AggReceivableBillVO aggReceivableBillVO = new AggReceivableBillVO();
|
|
|
ReceivableBillVO receivableBillVO = new ReceivableBillVO();
|
|
@@ -234,25 +258,32 @@ public class HrLaborcostcopyPlugin implements IBackgroundWorkPlugin {
|
|
|
debitamounttotal = debitamounttotal.add(total);
|
|
|
Double dtotal = -total.toDouble();
|
|
|
UFDouble fstotal = new UFDouble(dtotal);
|
|
|
- if (waorg.equals(wa_org)) {
|
|
|
+ // 2025-03-25
|
|
|
+ if (waorg.equals(wa_org)&&costorg.equals(cost_org)) {
|
|
|
// 赋值子表数据
|
|
|
receivableBillItemVO.setPk_org(pk_org);
|
|
|
receivableBillItemVO.setPk_org_v(pk_org_v);
|
|
|
receivableBillItemVO.setPk_group(pk_group);
|
|
|
receivableBillItemVO.setPk_fiorg(pk_org);// 应收财务组织
|
|
|
- receivableBillItemVO.setDef30(outlaytypeIDMap.get(outlaytype));// 费用归属
|
|
|
+ receivableBillItemVO.setDef30(getDefdocPKByName("05",outlaytypeMemoMap.get(outlaytype)));// 费用归属—备注
|
|
|
+ receivableBillItemVO.setDef23(outlaytype);// 费用归属类别
|
|
|
receivableBillItemVO.setDef26(GetDataUtil.getDefdocPK("S00009", "08", "代垫费用"));// 收款摘要:S00009代垫费用
|
|
|
- receivableBillItemVO.setDef29(GetDataUtil.getDefdocPKByName("YS001", "人工成本结算--" + wa_typeMemoMap.get(wa_type)));// 收款业务性质:人工成本结算
|
|
|
+ String watypeNewName= wa_typeMemoMap.get(wa_type);
|
|
|
+// if("辞退福利".equals(watypeNewName)) {
|
|
|
+// watypeNewName="辞退补偿";
|
|
|
+// }
|
|
|
+// receivableBillItemVO.setDef29(getDefdocPKByName("YS001", "人工成本结算--" + watypeNewName));// 收款业务性质:人工成本结算
|
|
|
+ receivableBillItemVO.setDef29(getDefdocPKByName("YS001", "暂估人工成本结算-" + watypeNewName));// 收款业务性质:人工成本结算
|
|
|
receivableBillItemVO.setDef15(GetDataUtil.getDefdocPK("其他合同(财务专用)", "01", "其他合同(财务专用)"));// 经营合同名称
|
|
|
receivableBillItemVO.setDef16("其他合同(财务专用)");// 合同编号
|
|
|
receivableBillItemVO.setDef10(year + month + "人力成本备份" + workercode + name);// 备注
|
|
|
- receivableBillItemVO.setCustomer(getCustomerPKByName(cost_orgname));// 客户
|
|
|
+ receivableBillItemVO.setCustomer(getCustomerPKBynameOrPkorg(cost_orgname,cost_org));// 客户
|
|
|
// receivableBillItemVO.setOrdercubasdoc(getCustomerPKByName(cost_orgname));// 订单客户
|
|
|
receivableBillItemVO.setTaxcodeid(GetDataUtil.getTaxcodePK("10"));// 税码
|
|
|
receivableBillItemVO.setTaxrate(new UFDouble(0));// 税率
|
|
|
receivableBillItemVO.setLocal_money_bal(total);// 组织本币余额
|
|
|
receivableBillItemVO.setLocal_money_de(total);// 价税合计
|
|
|
- receivableBillItemVO.setLocal_notax_de(total);// 金额
|
|
|
+ receivableBillItemVO.setLocal_notax_de(total);// 金额cost_or
|
|
|
receivableBillItemVO.setLocal_tax_de(new UFDouble(0));// 税额
|
|
|
receivableBillItemVO.setLocal_price(total);// 本币单价
|
|
|
receivableBillItemVO.setLocal_taxprice(total);// 本币含税单价
|
|
@@ -390,6 +421,27 @@ public class HrLaborcostcopyPlugin implements IBackgroundWorkPlugin {
|
|
|
}
|
|
|
return tyMap;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询费用归属类别备注
|
|
|
+ *
|
|
|
+ * @throws
|
|
|
+ * @throws DAOException
|
|
|
+ */
|
|
|
+ public Map<String, String> getOutlaytypeMemo() throws Exception {
|
|
|
+ String sql = "select name,memo from bd_defdoc where pk_defdoclist = (select pk_defdoclist from bd_defdoclist where code = 'HRFI01' and nvl(dr,0) = 0) and enablestate = '2' and nvl(dr,0) = 0";
|
|
|
+ List<Map<String, String>> listMap = (List<Map<String, String>>) new BaseDAO().executeQuery(sql, new MapListProcessor());
|
|
|
+ Map<String, String> tyMap = new HashMap<String, String>();
|
|
|
+ if (listMap == null || listMap.size() <= 0)
|
|
|
+ return tyMap;
|
|
|
+ for (int i = 0; i < listMap.size(); i++) {
|
|
|
+ Map<String, String> map = listMap.get(i);
|
|
|
+ String name = map.get("name");
|
|
|
+ String memo = map.get("memo");
|
|
|
+ tyMap.put(name, memo);
|
|
|
+ }
|
|
|
+ return tyMap;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 查询是否代发id
|
|
@@ -666,12 +718,25 @@ public class HrLaborcostcopyPlugin implements IBackgroundWorkPlugin {
|
|
|
return pk_currtype != null ? pk_currtype + "" : "";
|
|
|
}
|
|
|
|
|
|
+ //自定义档案
|
|
|
+ private String getDefdocPKByName(String defdoclistcode,String name) throws Exception {
|
|
|
+ if("".equals(name)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ String sql = "select pk_defdoc from bd_defdoc where pk_defdoclist = (select pk_defdoclist from bd_defdoclist where code = '"+defdoclistcode+"' and nvl(dr,0) = 0) and name = '"+name+"' and enablestate = '2' and nvl(dr,0) = 0";
|
|
|
+ String pk_defdoc = (String) iuap.executeQuery(sql, new ColumnProcessor());
|
|
|
+ if (pk_defdoc == null) {
|
|
|
+ throw new Exception("获取"+name+"信息失败,未找到与参数" + name + "有关的数据!");
|
|
|
+ }
|
|
|
+ return pk_defdoc;
|
|
|
+ }
|
|
|
+
|
|
|
// 客户
|
|
|
- private String getCustomerPKByName(String name) throws Exception {
|
|
|
+ private String getCustomerPKBynameOrPkorg(String name,String pkorg) throws Exception {
|
|
|
if ("".equals(name)) {
|
|
|
return null;
|
|
|
}
|
|
|
- String sql = "select pk_customer from bd_customer where name = '" + name + "' and enablestate = '2' and nvl(dr,0) = 0";
|
|
|
+ String sql = "select pk_customer from bd_customer where ( name = '" + name + "' or pk_financeorg = '" + pkorg + "' ) and enablestate = '2' and nvl(dr,0) = 0";
|
|
|
String pk_customer = (String) iuap.executeQuery(sql, new ColumnProcessor());
|
|
|
if (pk_customer == null) {
|
|
|
throw new Exception("获取客户信息失败,未找到与参数" + name + "有关的数据!");
|