瀏覽代碼

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper into master

seyason 2 年之前
父節點
當前提交
c13466d906

+ 19 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -907,10 +907,11 @@ public class ReportController {
             LocalDateTime time = LocalDateTime.now();
             String format = time.format(df);
             String tokenOfYiWei = getTokenOfYiWei();
-            String url = "http://183.194.0.98:3202/controlCenter/billApply";
+            String url = "http://183.194.0.98:3202/api/web-server/controlCenter/billApply";
             HttpHeaders headers = new HttpHeaders();
             headers.setContentType(MediaType.APPLICATION_JSON);
             headers.add("token",tokenOfYiWei);
+            headers.add("Accept-Language","zh-CN");
             JSONObject body=new JSONObject();
             body.put("dataSource","工时管家");
             body.put("type","EXPENSE");
@@ -922,8 +923,8 @@ public class ReportController {
                 Optional<Project> first = targetProjectList.stream().filter(tl -> tl.getId().equals(report.getProjectId())).findFirst();
                 if(first.isPresent()){
                     JSONObject expenseDetail =new JSONObject();
-                    expenseDetail.put("company","");
-                    expenseDetail.put("department","");
+                    expenseDetail.put("company","FONE");
+                    expenseDetail.put("department","DEFAULT");
                     expenseDetail.put("project",first.get().getProjectCode());
                     expenseDetail.put("expenseItem","default");
                     expenseDetail.put("amount",report.getWorkingTime());
@@ -939,7 +940,19 @@ public class ReportController {
                 String resp = responseEntity.getBody();
                 JSONObject json = JSONObject.parseObject(resp);
                 if(json.getIntValue("status")==0){
-                    JSONArray jsonArray = json.getJSONArray("data");
+                    JSONArray data = json.getJSONArray("data");
+                    JSONObject jsonObject = data.getJSONObject(0);
+                    Integer availableBudgetAmount = jsonObject.getInteger("availableBudgetAmount");
+                    Integer occurredBudgetAmount = jsonObject.getInteger("occurredBudgetAmount");
+                    BigDecimal divide = new BigDecimal(occurredBudgetAmount).add(new BigDecimal(jsonObject.getInteger("amount"))).divide(new BigDecimal(availableBudgetAmount), 3, RoundingMode.HALF_UP);
+                    if(divide.doubleValue()>0.85){
+                        HttpRespMsg httpRespMsg=new HttpRespMsg();
+                        httpRespMsg.setError("当前预算占用已到85%");
+                    }
+                } else if(json.getIntValue("status")==14001){
+                    HttpRespMsg httpRespMsg=new HttpRespMsg();
+                    httpRespMsg.setError("当前项目预算不足,无法填报");
+                    return httpRespMsg;
                 }
             }
         }*/
@@ -1247,13 +1260,13 @@ public class ReportController {
 
 
     private String getTokenOfYiWei(){
-        String url = "http://183.194.0.98:3202/controlCenter/token";
+        String url = "http://183.194.0.98:3202/api/web-server/controlCenter/token";
         HttpHeaders headers = new HttpHeaders();
         String token="";
         headers.setContentType(MediaType.APPLICATION_JSON);
         JSONObject jsonObject=new JSONObject();
         jsonObject.put("appId","GongShi");
-        jsonObject.put("appSecret","6195e252f611785a5e1446e1");
+        jsonObject.put("appSecret","858a6e0b60d228a556d8e353ebbd2c5c");
         HttpEntity<String> requestEntity;
         requestEntity = new HttpEntity<String>(jsonObject.toJSONString(), headers);
         ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -3714,6 +3714,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         if (!StringUtils.isEmpty(part)) {
                             String[] partSplit = part.split("\\,|\\,");
                             for (String str : partSplit) {
+                                if(str.equals(inchargerCell.getStringCellValue())){
+                                    continue;
+                                }
                                 ProjectAuditor projectAuditor = new ProjectAuditor();
                                 String s1;
                                 if(str.startsWith("/")){
@@ -4867,6 +4870,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         if (!StringUtils.isEmpty(part)) {
                             String[] partSplit = part.split("\\,|\\,");
                             for (String str : partSplit) {
+                                if(str.equals(inchargerCell.getStringCellValue())){
+                                    continue;
+                                }
                                 String s1;
                                 if(str.startsWith("/")){
                                     s1=str.substring(1,str.length());

+ 7 - 9
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1645,11 +1645,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                 r.setAuditDeptManagerid(department.get().getManagerId());
                                 r.setIsDeptAudit(1);
                                 r.setAuditDeptid(department.get().getDepartmentId());
-                                if(department.get().getManagerId().equals(r.getProjectAuditorId())){
-                                    r.setState(1);
-                                    r.setDepartmentAuditState(1);
-                                }
-                            }else r.setState(1);
+                                r.setState(1);
+                                r.setDepartmentAuditState(1);
+                            }
                         }
                     }
                     updateReportList.add(r);
@@ -1658,7 +1656,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     updateBatchById(updateReportList);
                 }
                 /*if(company.getId()==862){
-                    String url = "http://183.194.0.98:3202/controlCenter/billApproved";
+                    String url = "http://183.194.0.98:3202/api/web-server/controlCenter/billApproved";
                     HttpHeaders headers = new HttpHeaders();
                     headers.setContentType(MediaType.APPLICATION_JSON);
                     headers.add("token",getTokenOfYiWei());
@@ -1939,13 +1937,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
 
     private String getTokenOfYiWei(){
-        String url = "http://183.194.0.98:3202/controlCenter/token";
+        String url = "http://183.194.0.98:3202/api/web-server/controlCenter/token";
         HttpHeaders headers = new HttpHeaders();
         String token="";
         headers.setContentType(MediaType.APPLICATION_JSON);
         JSONObject jsonObject=new JSONObject();
         jsonObject.put("appId","GongShi");
-        jsonObject.put("appSecret","6195e252f611785a5e1446e1");
+        jsonObject.put("appSecret","858a6e0b60d228a556d8e353ebbd2c5c");
         HttpEntity<String> requestEntity;
         requestEntity = new HttpEntity<String>(jsonObject.toJSONString(), headers);
         ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
@@ -2169,7 +2167,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             updateBatchById(newList);
         }
         /*if(company.getId()==862){
-            String url = "http://183.194.0.98:3202/controlCenter/billRejected";
+            String url = "http://183.194.0.98:3202/api/web-server/controlCenter/billRejected";
             HttpHeaders headers = new HttpHeaders();
             headers.setContentType(MediaType.APPLICATION_JSON);
             headers.add("token",getTokenOfYiWei());

二進制
fhKeeper/formulahousekeeper/management-platform/src/main/resources/upload/项目导入模板.xlsx


+ 7 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -938,13 +938,19 @@
                   </template>
                 </el-table-column>
                 <el-table-column  prop="happenDate" :label="$t('forthedate')" ></el-table-column>
-                <el-table-column prop="invoiceType" :label="$t('costtype')"    >
+                <!-- <el-table-column prop="invoiceType" :label="$t('costtype')"    >
                   <template slot-scope="scope">
                         {{feeType[scope.row.invoiceType]}}
                     </template>
                 </el-table-column>
                 <el-table-column prop="expenseType" :label="$t('ppertype')"  >
                   
+                </el-table-column> -->
+                <el-table-column prop="expenseType" :label="$t('costtype')"></el-table-column>
+                <el-table-column prop="invoiceType" :label="$t('ppertype')">
+                  <template slot-scope="scope">
+                    {{scope.row.invoiceType == 0 ? '增值税专用发票' : '增值税普通发票'}}
+                  </template>
                 </el-table-column>
                 <el-table-column prop="amount" :label="$t('amountof')+'('+ $t('tax') +')'"   align="right">
                   <template slot-scope="scope">

+ 47 - 10
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -73,7 +73,7 @@
 
             </el-form-item>
             <!-- 填报日期 -->
-            <el-form-item :label="$t('fillinthedate')" style="position: relative;top: 38px;" prop="createDate">
+            <el-form-item :label="$t('fillinthedate')" style="position: relative;top: 38px;">
               <el-col :span="11">
                 <el-date-picker type="date" :placeholder="$t('optiondate')" v-model="addForm.createDate" value-format="yyyy-MM-dd" style="width: 200px;"></el-date-picker>
               </el-col>
@@ -1035,7 +1035,6 @@ export default {
     },
     // 提交事件
     submits() {
-      
       this.$refs.mainAddForm.validate(valid => {
             if (valid) {
               if (this.invoiceList.length == 0) {
@@ -1045,14 +1044,52 @@ export default {
                 });
                 return;
               }
+              let strObj = {
+                project: '',
+                datas: '',
+                fptype: '',
+                fyType: '',
+                rmb: '',
+                flg: false
+              }
+              for(var i in this.invoiceList) {
+                if(!this.invoiceList[i].projectId) {
+                  strObj.project = '所属项目'
+                  strObj.flg = true
+                }
+                if(!this.invoiceList[i].invoiceType || this.invoiceList[i].invoiceType == '') {
+                  strObj.fptype = '发票种类'
+                  strObj.flg = true
+                }
+                if(!this.invoiceList[i].expenseType || this.invoiceList[i].expenseType == '') {
+                  strObj.fyType = '费用类型'
+                  strObj.flg = true
+                }
+                if(!this.invoiceList[i].happenDate || this.invoiceList[i].happenDate == '') {
+                  strObj.datas = '费用日期'
+                  strObj.flg = true
+                }
+                if(!this.invoiceList[i].amount || this.invoiceList[i].amount == '') {
+                  strObj.rmb = '费用金额'
+                  strObj.flg = true
+                }
+              }
+              if(strObj.flg) {
+                this.$message({
+                    message: `${strObj.project} ${strObj.fptype} ${strObj.fyType} ${strObj.datas} ${strObj.rmb} 请填写完整`,
+                    type: "error"
+                });
+                return;
+              }
+                // return
               this.add();
-                  this.addForm = {
-                    code:null,
-                    ownerId:this.user.id,
-                    createDate: null,
-                    type:this.z, 
-                    ticketNum:1,remark:null,totalAmount:0,}
-                  this.invoiceList = []
+              this.addForm = {
+                code:null,
+                ownerId:this.user.id,
+                createDate: null,
+                type:this.z, 
+                ticketNum:1,remark:null,totalAmount:0,}
+              this.invoiceList = []
                   
               
             }
@@ -1061,7 +1098,7 @@ export default {
     },
     // 点击新增
     addxz() {
-      this.form = {happenDate: null,invoiceType:null,amount:null,invoiceNo:null,taxPercent:null,taxValue:null,remark:null,pic: null},
+      this.form = {happenDate: null  ,invoiceType:null,amount:null,invoiceNo:null,taxPercent:null,taxValue:null,remark:null,pic: null},
       this.invoiceList.push(this.form)
     },
     addNewInvoice(){