Forráskód Böngészése

Merge branch 'master' of http://111.75.220.136:10030/turborao/jyyy

lisheng 1 hete
szülő
commit
4dcf395f4d

+ 25 - 10
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/operate/SapVoucherSaveOpPlugin.java

@@ -43,27 +43,32 @@ public class SapVoucherSaveOpPlugin extends AbstractOperationServicePlugIn {
         DynamicObject[] billEntities = e.getDataEntities();
 
         List<Long> publicIds = new ArrayList<>();
+        List<Long> tripIds = new ArrayList<>();
+
         for (DynamicObject billInfo : billEntities) {
             DynamicObjectCollection entrys = billInfo.getDynamicObjectCollection("entryentity");
             for(DynamicObject entry : entrys){
+                if(StringUtils.isEmpty(entry.getString("nckd_bxbillno"))){
+                    continue;
+                }
+
                 String billNo = entry.getString("nckd_bxbillno");
                 Long billId = entry.getLong("nckd_bxbillid");
-                String entityName = "";
-                if("CL".equals(billNo.substring(0, 2))){
 
-                } else {
-                    entityName = "er_publicreimbursebill";
+                //差旅报销单
+                if("CL".equals(billNo.substring(0, 2))){
+                    tripIds.add(billId);
                 }
-
-                if(StringUtils.isEmpty(entityName)){
-                    continue;
+                //对公报销单
+                else {
+                    publicIds.add(billId);
                 }
-
-                publicIds.add(billId);
             }
         }
 
-        String operationKey = "nckd_returnbudget";
+        String operationKey = "nckd_returnbudge";
+
+        //对公报销单返还
         if(publicIds.size() > 0) {
             String entityName = "er_publicreimbursebill";
             MainEntityType entityType= EntityMetadataCache.getDataEntityType(entityName);
@@ -72,5 +77,15 @@ public class SapVoucherSaveOpPlugin extends AbstractOperationServicePlugIn {
             //调用报销付款单预算返还操作
             OperationResult returnResult = OperationServiceHelper.executeOperate(operationKey, entityName, publicBills, OperateOption.create());
         }
+
+        //差旅报销单返还
+        if(publicIds.size() > 0) {
+            String entityName = "er_tripreimbursebill";
+            MainEntityType entityType= EntityMetadataCache.getDataEntityType(entityName);
+            DynamicObject[] publicBills = BusinessDataServiceHelper.load(publicIds.toArray(), entityType);
+
+            //调用报销付款单预算返还操作
+            OperationResult returnResult = OperationServiceHelper.executeOperate(operationKey, entityName, publicBills, OperateOption.create());
+        }
     }
 }

+ 15 - 0
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/webapi/SRMSynPayApiPlugin.java

@@ -692,6 +692,11 @@ public class SRMSynPayApiPlugin implements Serializable {
             String serialNo = jsonData.getString("serialNo");//发票流水号
             String taxAmount = jsonData.getString("taxAmount");//税额
 
+            if(StringUtils.isEmpty(serialNo)){
+                returnMessage = "发票分录的第" + (i + 1) + "行的发票流水号不能为空";
+                return buildReturnData(code, srmBillNo, returnMessage, null, null, null);
+            }
+
             Long invoiceEntryId = DB.genLongId("er_publicreimbursebill.invoiceentry");
 
             DynamicObject entry = new DynamicObject(type);
@@ -781,6 +786,16 @@ public class SRMSynPayApiPlugin implements Serializable {
                     entry.set("poolreimburseamount", CommonHelperUtils.getBigDecimal(invoiceObj.getBigDecimal("totalAmount")));//本次报销金额
                     entry.set("transportnote", "0");//运输票据
 
+                    entry.set("ismutilreimburse", true);//多次报销
+                    QFilter qFilterSerialNo = new QFilter("serialno", QCP.equals, serialNo);
+                    DynamicObject billingPool = BusinessDataServiceHelper.loadSingle("er_billingpool", qFilterSerialNo.toArray());
+                    if(billingPool != null){
+                        entry.set("billingpoolid", billingPool.getLong("id"));//账单id
+                        entry.set("oribalanceamount", billingPool.getBigDecimal("oribalanceamount"));//可用余额
+                        entry.set("poolreimburseamount", billingPool.getBigDecimal("oribalanceamount"));//可用余额
+                    }
+
+
                     String invoiceGoodsName = "";
 
                     List<String> invoiceGoodsCode = new ArrayList<>();

+ 127 - 0
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/hspm/formplugin/web/reform/file/web/employee/ResumePrintPlugin.java

@@ -0,0 +1,127 @@
+package nckd.jimin.jyyy.hr.hspm.formplugin.web.reform.file.web.employee;
+
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.resource.ResManager;
+import kd.bos.entity.datamodel.ListSelectedRow;
+import kd.bos.entity.datamodel.ListSelectedRowCollection;
+import kd.bos.entity.property.PKFieldProp;
+import kd.bos.form.FormConfig;
+import kd.bos.form.FormShowParameter;
+import kd.bos.form.IMobileView;
+import kd.bos.form.ShowType;
+import kd.bos.form.events.AfterDoOperationEventArgs;
+import kd.bos.form.operate.AbstractOperate;
+import kd.bos.form.plugin.AbstractFormPlugin;
+import kd.bos.list.IListView;
+import kd.bos.list.IMobileListView;
+import kd.bos.logging.Log;
+import kd.bos.logging.LogFactory;
+import kd.bos.metadata.dao.MetaCategory;
+import kd.bos.metadata.dao.MetadataDao;
+import kd.bos.metadata.form.FormMetadata;
+import kd.bos.orm.query.QCP;
+import kd.bos.orm.query.QFilter;
+import kd.bos.orm.util.CollectionUtils;
+import kd.bos.report.IReportView;
+import kd.bos.servicehelper.QueryServiceHelper;
+import kd.bos.servicehelper.user.UserServiceHelper;
+import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
+import kd.hr.hbp.common.util.HRStringUtils;
+import kd.hr.hspm.formplugin.print.ResumeListPrintPlugin;
+import kd.hrmp.hrpi.business.domian.service.impl.PersonServiceImpl;
+import kd.sdk.hr.hspm.common.utils.QFilterUtil;
+
+import java.text.MessageFormat;
+import java.util.*;
+
+public class ResumePrintPlugin extends AbstractFormPlugin {
+    private static final Log LOGGER = LogFactory.getLog(ResumeListPrintPlugin.class);
+    private static final String KEY_SELECTTPLPRINT_EXT = "selecttplprintext";
+    private static final HRBaseServiceHelper HSPM_ERMANFILE = new HRBaseServiceHelper("hspm_ermanfile");
+    private static final int MAX_SELECT_COUNT = 1000;
+    private static final long POST_FULLTIME = 1010L;
+    private static final String KEY_EMPPOSREL_POSTID = "empposrel.postype.id";
+
+
+    public ResumePrintPlugin() {
+    }
+
+    public void afterDoOperation(AfterDoOperationEventArgs args) {
+        super.afterDoOperation(args);
+        AbstractOperate operate = (AbstractOperate)args.getSource();
+        String opKey = operate.getOperateKey();
+        if (HRStringUtils.equals("selecttplprintext", opKey)) {
+            this.showSelectPrintForm();
+        }
+
+    }
+
+    private void showSelectPrintForm() {
+        List<Object> pkids = this.getPKIds();
+        if (pkids.size() > 1000) {
+            this.getView().showMessage(MessageFormat.format(ResManager.loadKDString("打印失败,一次最多可选择的数据条数为:{0}。", "ResumeListPrintPlugin_4", "hr-hspm-formplugin", new Object[0]), 1000));
+        } else {
+            List<Long> ids = new ArrayList(pkids.size());
+            Set<Long> filterEmployeeIds = new HashSet(pkids.size());
+            DynamicObject[] dys = HSPM_ERMANFILE.query("employee.id,empposrel.postype,businessstatus", new QFilter[]{new QFilter("id", "in", pkids)});
+            if (dys != null && dys.length > 0) {
+                DynamicObject[] var5 = dys;
+                int var6 = dys.length;
+
+                for(int var7 = 0; var7 < var6; ++var7) {
+                    DynamicObject dy = var5[var7];
+                    long employeeId = dy.getLong("employee.id");
+                    if (employeeId != 0L && "1".equals(dy.getString("businessstatus")) && 1010L == dy.getLong("empposrel.postype.id") && filterEmployeeIds.add(employeeId)) {
+                        ids.add(dy.getLong("id"));
+                    }
+                }
+            }
+
+            if (CollectionUtils.isEmpty(ids)) {
+                this.getView().showMessage(MessageFormat.format(ResManager.loadKDString("打印失败:没有符合条件的人员档案。请选择生效中的全职任职档案进行打印。", "ResumeListPrintPlugin_5", "hr-hspm-formplugin", new Object[0]), 1000));
+            } else {
+                String text = MessageFormat.format(ResManager.loadKDString("将打印生效中的全职任职档案(共选择:{0},将打印{1})。", "ResumeListPrintPlugin_6", "hr-hspm-formplugin", new Object[0]), pkids.size(), ids.size());
+                String formId = "hspm_erfilelistreform";
+                String id = MetadataDao.getIdByNumber(formId, MetaCategory.Form);
+                FormMetadata fm = (FormMetadata)MetadataDao.readMeta(id, MetaCategory.Form);
+                String oriFormId = MetadataDao.getNumberById(fm.getEntityId());
+                formId = oriFormId;
+                if (this.getView() instanceof IMobileView) {
+                    FormConfig fc = this.getView().getFormShowParameter().getFormConfig();
+                    formId = fc.getEntityTypeId();
+                }
+
+                FormShowParameter param = new FormShowParameter();
+                param.getOpenStyle().setShowType(ShowType.Modal);
+                param.setFormId("bos_selecttemplate");
+                param.setCustomParam("formid", formId);
+                param.setCustomParam("pkids", ids);
+                param.setCustomParam("type", "printpreview");
+                param.setCustomParam("showalltpl", Boolean.TRUE);
+                param.setCustomParam("text", text);
+                this.getView().showForm(param);
+            }
+        }
+    }
+
+    private List<Object> getPKIds() {
+        List<Object> pkids = new ArrayList();
+        //查询当前人员 生效中的全职任职的ermanfileId
+        //pkids.add(2218386780892185612L);
+        Long userId = UserServiceHelper.getCurrentUserId();
+        Long personId = 999999L;
+        Map<String, Object> map = PersonServiceImpl.getInstance().getPersonModelIdByUserId(userId);
+        if(Boolean.valueOf(map.get("success").toString())) {
+            personId = Long.valueOf(((Map) map.get("data")).get("person").toString());
+        }
+
+        QFilter filter = QFilterUtil.getCurrentQf();
+        filter.and("filetype.number", QCP.equals, "1010_S");
+        filter.and("person.id", QCP.equals, personId);
+        DynamicObject[] ermanFileDyn = HSPM_ERMANFILE.query("id", new QFilter[]{filter}, "startdate desc", 1);
+        if(ermanFileDyn.length > 0) {
+            pkids.add(ermanFileDyn[0].get("id"));
+        }
+        return pkids;
+    }
+}

+ 7 - 2
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/swc/hcdm/formplugin/web/AdjustJobBillEffectOp.java

@@ -12,6 +12,7 @@ import kd.bos.logging.Log;
 import kd.bos.logging.LogFactory;
 import kd.bos.servicehelper.BusinessDataServiceHelper;
 import kd.bos.servicehelper.operation.SaveServiceHelper;
+import kd.bos.servicehelper.user.UserServiceHelper;
 import kd.sdk.plugin.Plugin;
 import kd.swc.hcdm.business.salaryadjfile.DecAdjInfoServiceHelper;
 import kd.tdc.tjga.business.task.ScheduleExecutor;
@@ -108,8 +109,12 @@ public class AdjustJobBillEffectOp extends AbstractOperationServicePlugIn implem
                     SaveServiceHelper.save(new DynamicObject[]{bill});
                     throw new KDBizException("定调薪信息出错,请查看薪酬调整明细同步薪酬日志");
                 }
-
-                SaveServiceHelper.save(new DynamicObject[]{bill});
+                else {
+                    bill.set("billstatus", "C");
+                    bill.set("auditor", UserServiceHelper.getCurrentUserId());
+                    bill.set("auditdate",new Date());
+                    SaveServiceHelper.save(new DynamicObject[]{bill});
+                }
             }
         }
 

+ 7 - 7
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/swc/hsas/calperson/CalPersonExtService.java

@@ -88,13 +88,13 @@ public class CalPersonExtService implements IAddCalPersonExtService {
         for(Map<String,Object> data : datas) {
             Long personId = Long.valueOf(data.get("person.id").toString());
             DynamicObject paySettingDyn = paySettingMap.get(personId);
-            if(ObjectUtils.isEmpty(paySettingDyn))
-                continue;
-            //银行卡信息塞值
-            if(perBankCardFields != null) {
-                for (String field : perBankCardFields) {
-                    Object fieldValue = paySettingDyn.get("entryentity.perbankcard." + field);
-                    data.put("hrpi_perbankcard" + "." + field, fieldValue);
+            if(!ObjectUtils.isEmpty(paySettingDyn)) {
+                //银行卡信息塞值
+                if (perBankCardFields != null) {
+                    for (String field : perBankCardFields) {
+                        Object fieldValue = paySettingDyn.get("entryentity.perbankcard." + field);
+                        data.put("hrpi_perbankcard" + "." + field, fieldValue);
+                    }
                 }
             }
             //合同信息塞值

+ 8 - 8
code/jyyy/nckd-jimin-jyyy-hr/src/main/java/nckd/jimin/jyyy/hr/swc/hsas/util/CalPersonUtil.java

@@ -87,15 +87,15 @@ public class CalPersonUtil {
         filter2.and("startdate", QCP.less_equals, lastDate);
         QFilter dateFilter = filter1.or(filter2);
         QFilter filter = personFilter.and(dateFilter);
-        String selectFields = "person.id,actualsigncompany.id";
-        DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter});
+        String selectFields = "person.id,actualsigncompany.id,startdate";
+        DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter},"startdate desc");
         //按照person.id提取
         Map contractMap = contractCols.stream().collect(Collectors.toMap((dyx) -> {
             return dyx.getLong("person.id");
         }, (dyx) -> {
             return dyx.getLong("actualsigncompany.id");
-        }, (key1, key2) -> {
-            return key2;
+        }, (value1, value2) -> {
+            return value1;
         }));
         return contractMap;
     }
@@ -118,15 +118,15 @@ public class CalPersonUtil {
         filter2.and("startdate", QCP.less_equals, date);
         QFilter dateFilter = filter1.or(filter2);
         QFilter filter = personFilter.and(dateFilter);
-        String selectFields = "person.id,actualsigncompany.id";
-        DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter});
+        String selectFields = "person.id,actualsigncompany.id,startdate";
+        DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter},"startdate desc");
         //按照person.id提取
         Map contractMap = contractCols.stream().collect(Collectors.toMap((dyx) -> {
             return dyx.getLong("person.id");
         }, (dyx) -> {
             return dyx.getLong("actualsigncompany.id");
-        }, (key1, key2) -> {
-            return key2;
+        }, (value1, value2) -> {
+            return value1;
         }));
         return contractMap;
     }