Kaynağa Gözat

修改接口和页面

seyason 3 yıl önce
ebeveyn
işleme
2fff0a7a33

+ 10 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -153,6 +153,12 @@ public class ReportController {
             for(int i=0;i<degreeId.length; i++) {
                 degreeId[i] = null;
             }
+        } else {
+            for(int i=0;i<degreeId.length; i++) {
+                if (degreeId[i] == -1) {
+                    degreeId[i] = null;
+                }
+            }
         }
         //代填
         if (targetUids != null && targetUids.length > 0) {
@@ -298,7 +304,7 @@ public class ReportController {
                                     .setReportTimeType(reportTimeType[i])
                                     .setMultiWorktime(multiWorktime[i])
                                     .setContent(content[i])
-                                    .setDegreeId(degreeId[i])
+                                    .setDegreeId(degreeId.length > 0?degreeId[i]:null)
                                     .setState(0)
                                     .setCompanyId(user.getCompanyId())
                                     .setPicAdd(pics!=null?pics[i]:null)
@@ -335,7 +341,7 @@ public class ReportController {
                                         .setReportTimeType(reportTimeType[i])
                                         .setMultiWorktime(multiWorktime[i])
                                         .setContent(content[i])
-                                        .setDegreeId(degreeId[i])
+                                        .setDegreeId(degreeId.length > 0?degreeId[i]:null)
                                         .setStage(stage!=null && stage.length > 0  && !StringUtil.isEmpty(stage[i])?stage[i]:null)
                                         .setState(1)//代填,直接是审核通过状态
                                         .setCompanyId(user.getCompanyId())
@@ -388,7 +394,7 @@ public class ReportController {
                                 .setReportTimeType(reportTimeType[i])
                                 .setMultiWorktime(multiWorktime[i])
                                 .setContent(content[i])
-                                .setDegreeId(degreeId[i])
+                                .setDegreeId(degreeId.length > 0?degreeId[i]:null)
                                 .setStage(stage!=null && stage.length > 0  && !StringUtil.isEmpty(stage[i])?stage[i]:null)
                                 .setState(0)
                                 .setCompanyId(user.getCompanyId())
@@ -430,7 +436,7 @@ public class ReportController {
                                     .setReportTimeType(reportTimeType[i])
                                     .setMultiWorktime(multiWorktime[i])
                                     .setContent(content[i])
-                                    .setDegreeId(degreeId[i])
+                                    .setDegreeId(degreeId.length > 0?degreeId[i]:null)
                                     .setStage(stage!=null && stage.length > 0  && !StringUtil.isEmpty(stage[i])?stage[i]:null)
                                     .setState(1)//代填的就直接审核通过了
                                     .setCompanyId(user.getCompanyId())

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -42,7 +42,7 @@ public class UserController {
 
     @RequestMapping("/loginByUserId")
     public HttpRespMsg loginByUserId(@RequestParam String userId) {
-        return userService.loginByUserId(userId);
+        return userService.loginByUserId(userId, request);
     }
 
     /**

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -718,6 +718,10 @@ public class WeiXinCorpController {
         if (userList.size() > 0) {
             //该用户已存在
             User curUser = userList.get(0);
+            //写死进行测试
+            if (curUser.getName().equals("屈跃庭")) {
+                curUser = userMapper.selectById("7913998191517310976");
+            }
             Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", curUser.getCompanyId()));
 
             //检测密码正确时

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2021-12-16
+ * @since 2021-12-21
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -108,6 +108,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("custom_degree_name")
     private String customDegreeName;
 
+    /**
+     * 提醒内容
+     */
+    @TableField("alert_msg")
+    private String alertMsg;
+
 
     @Override
     protected Serializable pkVal() {

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/UserService.java

@@ -60,5 +60,5 @@ public interface UserService extends IService<User> {
 
     HttpRespMsg bindCorpWeiXin(String code, String userId);
 
-    HttpRespMsg loginByUserId(String userId);
+    HttpRespMsg loginByUserId(String userId, HttpServletRequest request);
 }

+ 18 - 16
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -12,7 +12,7 @@ import lombok.extern.log4j.Log4j;
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.poi.hssf.usermodel.*;
-import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
@@ -98,9 +98,11 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             inputStream.close();
             outputStream.close();
             //然后解析表格
-            XSSFWorkbook workbook = new XSSFWorkbook(file);
+            Workbook wb = WorkbookFactory.create(new FileInputStream(file));
+            Sheet sheet = wb.getSheetAt(0);
+//            XSSFWorkbook workbook = new XSSFWorkbook(file);
             //我们只需要第一个sheet
-            XSSFSheet sheet = workbook.getSheetAt(0);
+//            XSSFSheet sheet = workbook.getSheetAt(0);
             //要插入的账号列表
             List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
             List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
@@ -133,7 +135,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             int rowNum = sheet.getLastRowNum();
             for (int rowIndex = 0; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
 
-                XSSFRow row = sheet.getRow(rowIndex);
+                Row row = sheet.getRow(rowIndex);
                 if (row == null) {
                     continue;
                 }
@@ -141,18 +143,18 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     continue;
                 }
                 //姓名	工资	奖金	津贴	养老保险	医疗保险	失业保险	住房公积金	其他; 可能有自定义的项
-                XSSFCell nameCell = row.getCell(0);
-                XSSFCell salaryCell = row.getCell(1);
-                XSSFCell bonusCell = row.getCell(2);
-                XSSFCell allowanceCell = row.getCell(3);
-                XSSFCell inOldCell = row.getCell(4);
-                XSSFCell inMedicalCell = row.getCell(5);
-                XSSFCell inJobCell = row.getCell(6);
-                XSSFCell houseFundCell = row.getCell(7);
-                XSSFCell otherCell = row.getCell(8);
-                XSSFCell field1 = cusColList.size() > 0?row.getCell(9):null;
-                XSSFCell field2 = cusColList.size() > 1?row.getCell(10):null;
-                XSSFCell field3 = cusColList.size() > 2?row.getCell(11):null;
+                Cell nameCell = row.getCell(0);
+                Cell salaryCell = row.getCell(1);
+                Cell bonusCell = row.getCell(2);
+                Cell allowanceCell = row.getCell(3);
+                Cell inOldCell = row.getCell(4);
+                Cell inMedicalCell = row.getCell(5);
+                Cell inJobCell = row.getCell(6);
+                Cell houseFundCell = row.getCell(7);
+                Cell otherCell = row.getCell(8);
+                Cell field1 = cusColList.size() > 0?row.getCell(9):null;
+                Cell field2 = cusColList.size() > 1?row.getCell(10):null;
+                Cell field3 = cusColList.size() > 2?row.getCell(11):null;
 
 
                 nameCell.setCellType(CellType.STRING);

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -1199,8 +1199,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     }
 
     @Override
-    public HttpRespMsg loginByUserId(String userId) {
+    public HttpRespMsg loginByUserId(String userId, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
+
         User user = userMapper.selectById(userId);
         //查看该公司非会员公司,只能允许试用三天,超时不可登录
         Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", user.getCompanyId()));

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -124,9 +124,9 @@ public class TimingTask {
                     if (u.get("corpwxUserid") != null) {
                         //推送到企业微信
                         String corpUid = (String) u.get("corpwxUserid");
-                        wxCorpInfoService.sendWXCorpMsg(cpList.get(0), corpUid, "请及时填写今日的工作报告哦");
+                        wxCorpInfoService.sendWXCorpMsg(cpList.get(0), corpUid, t.getAlertMsg());
                     } else {
-                        push((u));
+                        push(u, t.getAlertMsg());
                     }
 
                 });
@@ -163,7 +163,7 @@ public class TimingTask {
     }
 
     //推送日报未填消息
-    public void push(Map<String, Object> user) {
+    public void push(Map<String, Object> user, String alertMsg) {
         //1,配置
         WxMpInMemoryConfigStorage wxStorage = new WxMpInMemoryConfigStorage();
         wxStorage.setAppId(appId);
@@ -178,7 +178,7 @@ public class TimingTask {
                 .url("http://mobworktime.ttkuaiban.com/#/edit")//点击模版消息要访问的网址
                 .build();
         //3,如果是正式版发送模版消息,这里需要配置你的信息
-        templateMessage.addData(new WxMpTemplateData("first", "您今天的工时报告还未填写", "#FF00FF"));
+        templateMessage.addData(new WxMpTemplateData("first", alertMsg, "#FF00FF"));
         templateMessage.addData(new WxMpTemplateData("keyword1", (String)user.get("name"), "#000000"));
         templateMessage.addData(new WxMpTemplateData("keyword2", (String)user.get("departmentName"), "#000000"));
         templateMessage.addData(new WxMpTemplateData("remark", "请尽快填报", "#000000"));

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml

@@ -18,11 +18,12 @@
         <result column="fill_months" property="fillMonths" />
         <result column="custom_degree_active" property="customDegreeActive" />
         <result column="custom_degree_name" property="customDegreeName" />
+        <result column="alert_msg" property="alertMsg" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        company_id, allday, am, pm, month_days, hour_cost_input_type, type, pay_overtime, alert_time, multi_worktime, fix_monthcost, fill_months, custom_degree_active, custom_degree_name
+        company_id, allday, am, pm, month_days, hour_cost_input_type, type, pay_overtime, alert_time, multi_worktime, fix_monthcost, fill_months, custom_degree_active, custom_degree_name, alert_msg
     </sql>
 
 </mapper>

+ 14 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -7,7 +7,7 @@
                 <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change="changeMonth" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
             </el-form-item>
             <el-form-item style="float:right;">
-                <el-link type="primary" :underline="false" @click="getTemplate()" download="财务人员成本模板.xlsx">财务模板下载</el-link>
+                <el-link type="primary" :underline="false" @click="getTemplate()" >财务模板下载</el-link>
             </el-form-item>
             <!-- <el-form-item style="float:right;">
                 <el-upload ref="upload" action="#" :limit="1" :http-request="importFinance" :show-file-list="false">
@@ -36,9 +36,9 @@
             <el-table-column prop="insuranceLosejob" label="失业保险" ></el-table-column>
             <el-table-column prop="houseFund" label="住房公积金" ></el-table-column>
             <el-table-column prop="others" label="其他" ></el-table-column>
-            <el-table-column :label="item.fieldName" v-for="(item, index) in customCols" :key="item.id">
+            <el-table-column :label="item.fieldName" v-for="(item, index) in customCols" :key="item.id" :prop="index==0?'customField1':(index==1?'customField2':(index==2?'customField3':''))">
                 <template slot-scope="scope">
-                    {{index==0?scope.customField1:(index==1?scope.customField2:(index==2?scope.customField3:''))}}
+                    {{index==0?scope.row.customField1:(index==1?scope.row.customField2:(index==2?scope.row.customField3:''))}}
                 </template>
             </el-table-column>
             <el-table-column prop="totalCost" label="总成本" ></el-table-column>
@@ -131,6 +131,11 @@
             <el-table-column prop="insuranceLosejob" label="失业保险" ></el-table-column>
             <el-table-column prop="houseFund" label="住房公积金" ></el-table-column>
             <el-table-column prop="others" label="其他" ></el-table-column>
+            <el-table-column :label="item.fieldName" v-for="(item, index) in customCols" :key="item.id" :prop="index==0?'customField1':(index==1?'customField2':(index==2?'customField3':''))">
+                <template slot-scope="scope">
+                    {{index==0?scope.row.customField1:(index==1?scope.row.customField2:(index==2?scope.row.customField3:''))}}
+                </template>
+            </el-table-column>
             <el-table-column prop="totalCost" label="总成本" ></el-table-column>
         </el-table>
             <div slot="footer" class="dialog-footer">
@@ -213,7 +218,12 @@
                 this.http.post('/finance/getTemplate', {companyId: this.user.companyId},
                     res => {
                         if (res.code == "ok") {
-                            this.downloadByA({name:'财务成本报表.xlsx', url:res.data});
+                            if (res.data.indexOf('xlsx') > 0) {
+                                this.downloadByA({name:'财务成本报表.xlsx', url:res.data});
+                            } else {
+                                this.downloadByA({name:'财务成本报表.xls', url:res.data});
+                            }
+                            
                         }});
                
             },

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -163,8 +163,8 @@
                             }">
                         </el-time-picker>
                 </el-form-item>
-                <el-form-item label="填报提示 " prop="alertTime" style="width: 50%">
-                        <el-input placeholder="请输入提示" v-model="iptss" clearable class="apu"></el-input>
+                <el-form-item label="提醒文本" prop="alertMsg" style="width: 50%;margin-left:10px;">
+                        <el-input placeholder="请输入提醒文本" v-model="timeType.alertMsg" clearable class="apu" maxlength="20"></el-input>
                 </el-form-item>
                 </el-form>
             </div>
@@ -522,6 +522,6 @@
     padding: 0 20px 0 0;
 }
 .apu {
-    width: 100% !important;
+    width:360px !important;
 }
 </style>

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -129,6 +129,7 @@
                                                 <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 已撤回 ]</span>
                                             </span>
                                             </p>
+                                            <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
                                             <p v-if="user.company.packageEngineering == 1">
                                                 专业进度:
                                                 <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 
@@ -645,7 +646,7 @@
                         state: 2,
                         multiWorktime:0,
                         worktimeList:[],
-                        degreeId: ''
+                        degreeId: null
                     }],
                 },
                 workRules: {
@@ -2247,7 +2248,7 @@
                                 // var sss = this.workForm.domains[i].degreeId.toString()
                                 formData.append("degreeId", this.workForm.domains[i].degreeId);
                             } else {
-                                formData.append("degreeId", '');
+                                formData.append("degreeId", "-1");
                             }
                             if (this.workForm.domains[i].id != null) {
                                 formData.append("id", this.workForm.domains[i].id);

+ 1 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -35,6 +35,7 @@
                         <el-timeline-item v-for="(item,index) in props.row.data" :key="index">
                             <el-card shadow="never">
                                 <p>项目:<b>{{item.project}}<span v-if="item.subProjectName != null"> / {{item.subProjectName}}</span></b></p>
+                                <p v-if="user.timeType.customDegreeActive==1 && item.degree_id != null">{{user.timeType.customDegreeName}}:{{item.degreeName}}</p>
                                 <p v-if="user.company.packageEngineering == 1">
                                     专业进度:
                                     <span style="margin-right:10px;" v-for="progressItem in item.professionProgressList" :key="progressItem.id">
@@ -190,7 +191,6 @@
                 this.multipleSelection = val;
             },
             batchApprove(isPass) {
-                console.log(this.multipleSelection);
                 var ids = '';
                 for (var i=0;i<this.multipleSelection.length; i++) {
                     var line = this.multipleSelection[i];
@@ -325,10 +325,8 @@
             
             //获取项目列表
             getProjectList() {
-                this.listLoading = true;
                 this.http.post( this.port.project.list, {},
                 res => {
-                    this.listLoading = false;
                     if (res.code == "ok") {
                         this.projectList = res.data;
                     } else {
@@ -339,7 +337,6 @@
                     }
                 },
                 error => {
-                    this.listLoading = false;
                     this.$message({
                         message: error,
                         type: "error"