Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

wanghaiwu před 3 dny
rodič
revize
e789cd9412

+ 1 - 1
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/form/HandInReceiveTicketPlugin.java

@@ -538,7 +538,7 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
 
     protected void beforeDoPrint(BeforeDoOperationEventArgs args){
         List<DynamicObject> selectRows = getSelectRows();
-        List<String> status = Arrays.asList("E", "F", "G");
+        List<String> status = Arrays.asList("E", "F", "G" , "I");
 
         for(DynamicObject selectRow : selectRows){
             DynamicObject billInfo = BusinessDataServiceHelper.loadSingle(selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_BILLID),

+ 13 - 7
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/webapi/ContractbillApiPlugin.java

@@ -54,19 +54,15 @@ public class ContractbillApiPlugin implements Serializable {
         log.info("合同附件上传-1");
         byte[] fileData = file.getFileData();
         String fileName = file.getFileName();
-        log.info("合同附件上传-2");
         Map<String,Object> map = new HashMap<>();
         TempFileCache cache = CacheFactory.getCommonCacheFactory().getTempFileCache();
-        log.info("合同附件上传-3");
         String tempUrl = cache.saveAsFullUrl(fileName, fileData,3600);
-        log.info("合同附件上传-4");
         CustomApiResult<Map<String,Object>> customApiResult = new CustomApiResult<>();
-        log.info("合同附件上传-5");
         map.put("tempurl",tempUrl);
         map.put("fileName",fileName);
         map.put("size",file.getFileData().length);
         customApiResult.setData(map);
-        log.info("合同附件上传-6");
+        log.info("合同附件上传-2");
         return customApiResult;
     }
 
@@ -265,6 +261,10 @@ public class ContractbillApiPlugin implements Serializable {
 
             dynamicObject.set("creator",applicatuser); // 创建人
             dynamicObject.set("createtime",new Date()); // 创建时间
+
+            dynamicObject.set("formid", "er_contractbill"); // 表单ID
+            dynamicObject.set("isenableinvoice", true); // 启用发票云
+            dynamicObject.set("currency", 1); // 本位币种
         }
         long pkid = dynamicObject.getLong("id");
 
@@ -435,13 +435,14 @@ public class ContractbillApiPlugin implements Serializable {
                 result.setStatus(false);
                 return result;
             }
-            BigDecimal fexpapplyamountBen =fexpapplyamount.multiply(huilv).setScale(2, RoundingMode.HALF_UP); // 含税金额本位币,四舍五入
+            BigDecimal fexpapplyamountBen =fexpapplyamount.multiply(huilv).setScale(2, RoundingMode.HALF_UP); // 含税金额(本位币) = 含税金额本位币 * 汇率,四舍五入
 
             // 确认合同单据本次是新增还是更新,分录接口只允许送一条记录
             DynamicObject newEntry3 = null;
             if (isnew) {
-                // 新增
+                // 新增(接口第一次调)
                 newEntry3 = new DynamicObject(plannewColl.getDynamicObjectType());
+                newEntry3.set("seq",1); // 分录序号
                 newEntry3.set("reimbursedamount",0); // 已报销金额
                 newEntry3.set("reimbursedcurramount",0); // 已报销金额(本位币)
                 newEntry3.set("oriexppayedamount",0); // 已付金额
@@ -452,6 +453,7 @@ public class ContractbillApiPlugin implements Serializable {
                 newEntry3.set("canloancurramount",fexpapplyamountBen); // 可预付金额(本位币)
                 newEntry3.set("orgiexpebalanceamount",fexpapplyamount); // 可报销金额
                 newEntry3.set("expebalanceamount",fexpapplyamountBen); // 可报销金额(本位币)
+                newEntry3.set("expquotetype","0"); // 换算方式:直接汇率 0,间接汇率 1
             } else {
                 // 更新
                 newEntry3 = plannewColl.get(0); // 分录只有一条记录
@@ -473,8 +475,11 @@ public class ContractbillApiPlugin implements Serializable {
             }
 
             newEntry3.set("orientryamount",fexpapplyamount); // 不含税金额
+            newEntry3.set("acorientryamount",fexpapplyamount); // 变更后不含税
             newEntry3.set("expenseamount",fexpapplyamount); // 含税金额
+            newEntry3.set("acexpeapproveamount",fexpapplyamount); // 变更后含税金额
             newEntry3.set("currexpenseamount",fexpapplyamountBen); // 含税金额(本位币),四舍五入
+            newEntry3.set("acexpeapprovecurramount",fexpapplyamountBen); // 变更后含税金额(本位币)
 
             // 累加给头表字段
             hetongjinetotalfist = hetongjinetotalfist.add(fexpapplyamount); // 进行累加付给合同金额
@@ -524,6 +529,7 @@ public class ContractbillApiPlugin implements Serializable {
             dynamicObject.set("frameworkcontract",false); // 框架合同:否
             dynamicObject.set("contractamount", hetongjinetotalfist); // 头表字段:合同总额(初始)
             dynamicObject.set("oriapplyamount", hetongjinetotalfist); // 头表字段:合同总额(变更后)
+            dynamicObject.set("applyamount", hetongjinetotalfist.multiply(huilv).setScale(2, RoundingMode.HALF_UP)); // 头表字段:合同总额(变更后)本位币 = 合同总额(变更后) * 汇率
             dynamicObject.set("originalamount", hetongjinetotalfist); // 头表字段:合同总额(不含税)
             if (isnew) {
                 // 第一次合同送入,新增

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

@@ -97,7 +97,7 @@ public class CalPersonUtil {
         QFilter dateFilter = filter1.or(filter2);
         QFilter filter = personFilter.and(dateFilter);
         String selectFields = "person.id,actualsigncompany.id,startdate,signstatus,signeddate";
-        DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter},"fstartdate desc,signstatus desc");
+        DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter},"startdate desc,signstatus desc");
         //按照person.id提取
         Map contractMap = contractCols.stream().collect(Collectors.toMap((dyx) -> {
             return dyx.getLong("person.id");
@@ -132,7 +132,7 @@ public class CalPersonUtil {
         QFilter dateFilter = filter1.or(filter2);
         QFilter filter = personFilter.and(dateFilter);
         String selectFields = "person.id,actualsigncompany.id,startdate,signstatus,signeddate";
-        DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter},"fstartdate desc,signstatus desc");
+        DynamicObjectCollection contractCols = QueryServiceHelper.query(CONTRACT_ENTITY, selectFields, new QFilter[]{filter},"startdate desc,signstatus desc");
         //按照person.id提取
         Map contractMap = contractCols.stream().collect(Collectors.toMap((dyx) -> {
             return dyx.getLong("person.id");