liuyc преди 2 години
родител
ревизия
625d6d3012

+ 14 - 0
blade-service-api/blade-control-api/src/main/java/org/springblade/control/vo/EMInvoiceInfoDetailVO.java

@@ -0,0 +1,14 @@
+package org.springblade.control.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class EMInvoiceInfoDetailVO implements Serializable {
+
+    private EMInvoiceInfoVO emInvoiceInfoVO;
+
+    private ContractInvoiceInfoVO contractInvoiceInfoVO;
+
+}

+ 1 - 1
blade-service/blade-control/src/main/java/org/springblade/control/controller/ExpenseManagerController.java

@@ -278,7 +278,7 @@ public class ExpenseManagerController extends BladeController {
     @GetMapping("/invoice/detail")
     @ApiOperationSupport(order = 33)
     @ApiOperation(value = "发票申请信息详情", notes = "传入发票申请信息id")
-    public R<EMInvoiceInfoVO> invoiceDetail(@RequestParam Long id) {
+    public R<EMInvoiceInfoDetailVO> invoiceDetail(@RequestParam Long id) {
         return R.data(invoiceService.invoiceDetail(id));
     }
 

+ 2 - 1
blade-service/blade-control/src/main/java/org/springblade/control/service/EMInvoiceService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.control.dto.EMInvoiceInfoDTO;
 import org.springblade.control.entity.EMInvoiceInfo;
 import org.springblade.control.vo.EMDraftVO;
+import org.springblade.control.vo.EMInvoiceInfoDetailVO;
 import org.springblade.control.vo.EMInvoiceInfoVO;
 import org.springblade.core.mp.base.BaseService;
 import org.springframework.web.multipart.MultipartFile;
@@ -17,7 +18,7 @@ public interface EMInvoiceService extends BaseService<EMInvoiceInfo> {
 
     List<EMDraftVO> invoiceDraftList();
 
-    EMInvoiceInfoVO invoiceDetail(Long id);
+    EMInvoiceInfoDetailVO invoiceDetail(Long id);
 
     boolean invoiceSubmit(EMInvoiceInfoDTO dto);
 

+ 36 - 3
blade-service/blade-control/src/main/java/org/springblade/control/service/impl/EMInvoiceServiceImpl.java

@@ -12,7 +12,9 @@ import org.springblade.control.entity.*;
 import org.springblade.control.mapper.ExMInvoiceMapper;
 import org.springblade.control.service.EMInvoiceService;
 import org.springblade.control.utils.BuildSerialUtils;
+import org.springblade.control.vo.ContractInvoiceInfoVO;
 import org.springblade.control.vo.EMDraftVO;
+import org.springblade.control.vo.EMInvoiceInfoDetailVO;
 import org.springblade.control.vo.EMInvoiceInfoVO;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
@@ -52,6 +54,7 @@ public class EMInvoiceServiceImpl extends BaseServiceImpl<ExMInvoiceMapper, EMIn
             EMInvoiceInfoVO vo = new EMInvoiceInfoVO();
             BeanUtils.copyProperties(obj, vo);
             vo.setCreateName(userMap.get(vo.getCreateUser()));
+            vo.setInvoiceUserName(userMap.get(vo.getCreateUser()));
             vo.setApprovalStatusName(vo.getStatus().equals(1) ? "待审批" : (vo.getStatus().equals(2) ? "已审批" : (vo.getStatus().equals(3) ? "已驳回" : "未上报")));
             vo.setApprovalResultName(vo.getApprovalStatusName().equals("已审批") || vo.getApprovalStatusName().equals("已驳回") ? "已通过" : "未通过");
             for (DictInfo dictInfo : dictInfoList1) {
@@ -99,10 +102,40 @@ public class EMInvoiceServiceImpl extends BaseServiceImpl<ExMInvoiceMapper, EMIn
     }
 
     @Override
-    public EMInvoiceInfoVO invoiceDetail(Long id) {
+    public EMInvoiceInfoDetailVO invoiceDetail(Long id) {
         EMInvoiceInfo obj = baseMapper.selectById(id);
-        EMInvoiceInfoVO vo = BeanUtil.copyProperties(obj, EMInvoiceInfoVO.class);
-        //TODO vo.set
+        EMInvoiceInfoVO voBasic = BeanUtil.copyProperties(obj, EMInvoiceInfoVO.class);
+        EMInvoiceInfoDetailVO vo = new EMInvoiceInfoDetailVO();
+        if (obj != null && voBasic != null) {
+            Map<Long, String> userMap = iUserClient.selectUserAll().stream().filter(f -> ObjectUtil.isNotEmpty(f.getRealName())).collect(Collectors.toMap(User::getId, User::getRealName));
+            ControlProjectInfo projectInfo = jdbcTemplate.query("select name from c_control_project_info where id = " + obj.getProjectId(), new BeanPropertyRowMapper<>(ControlProjectInfo.class)).stream().findAny().orElse(null);
+            if (projectInfo != null) {
+                voBasic.setProjectName(projectInfo.getName());
+            }
+            List<DictInfo> dictInfoListFP = jdbcTemplate.query("select dict_name,dict_value from c_dict_info where code = 'invoice_type'", new BeanPropertyRowMapper<>(DictInfo.class));
+            for (DictInfo dictInfo : dictInfoListFP) {
+                if (voBasic.getInvoiceType().equals(dictInfo.getDictValue().intValue())) {
+                    voBasic.setInvoiceTypeName(dictInfo.getDictName());
+                    break;
+                }
+            }
+            voBasic.setInvoiceUserName(userMap.get(voBasic.getInvoiceUserId()));
+
+            vo.setEmInvoiceInfoVO(voBasic);
+
+            List<ControlContractInfo> query = jdbcTemplate.query("select * from c_control_contract_info where project_id = " + obj.getProjectId(), new BeanPropertyRowMapper<>(ControlContractInfo.class));
+            if (query.size() == 1) {
+                ControlContractInfo controlContractInfo = query.get(0);
+                if (controlContractInfo != null) {
+                    ContractInvoiceInfoVO voFPDetail = BeanUtil.copyProperties(controlContractInfo, ContractInvoiceInfoVO.class);
+                    if (voFPDetail != null) {
+                        vo.setContractInvoiceInfoVO(voFPDetail);
+                    }
+                }
+            }
+            vo.setEmInvoiceInfoVO(voBasic);
+
+        }
         return vo;
     }
 

+ 12 - 5
blade-service/blade-control/src/main/java/org/springblade/control/service/impl/LogHistoryServiceImpl.java

@@ -178,10 +178,10 @@ public class LogHistoryServiceImpl extends BaseServiceImpl<LogHistoryMapper, Log
         if (ObjectUtil.isEmpty(SecureUtil.getDeptId())) {
             throw new ServiceException("获取部门信息失败,请联系管理员");
         }
+        LocalDate currentDate = LocalDate.now();
+        String formattedDate = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
         if (ObjectUtil.isEmpty(dto.getId())) {
             //判断今日是否已填写日志信息
-            LocalDate currentDate = LocalDate.now();
-            String formattedDate = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
             List<LogHistoryInfo> logHistoryInfos = baseMapper.selectList(Wrappers.<LogHistoryInfo>lambdaQuery()
                     .select(LogHistoryInfo::getId)
                     .eq(LogHistoryInfo::getUserId, SecureUtil.getUserId())
@@ -228,8 +228,15 @@ public class LogHistoryServiceImpl extends BaseServiceImpl<LogHistoryMapper, Log
         } else {
             //判断是否是本人操作
             LogHistoryInfo logHistoryInfo = baseMapper.selectById(dto.getId());
-            if (logHistoryInfo != null && !logHistoryInfo.getCreateUser().equals(SecureUtil.getUserId())) {
-                throw new ServiceException("暂无权限,不能编辑别人的日志信息");
+            if (logHistoryInfo != null) {
+                if (!logHistoryInfo.getCreateUser().equals(SecureUtil.getUserId())) {
+                    throw new ServiceException("不能编辑别人的日志信息");
+                }
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                String format = simpleDateFormat.format(logHistoryInfo.getCreateTime());
+                if (!format.equals(formattedDate)) {
+                    throw new ServiceException("只能编辑当天日志信息");
+                }
             }
             //编辑
             if (baseMapper.updateById(dto) > 0) {
@@ -557,7 +564,7 @@ public class LogHistoryServiceImpl extends BaseServiceImpl<LogHistoryMapper, Log
                 }
             }
         }
-        return resultList;
+        return resultList.stream().sorted(Comparator.comparing(TaskPlanInfoVO::getStatus)).collect(Collectors.toList());
     }
 
 }

+ 14 - 3
blade-service/blade-control/src/main/java/org/springblade/control/service/impl/TaskProcessServiceImpl.java

@@ -317,6 +317,7 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
                             case 7: //发票
                                 data = jdbcTemplate.query("select * from c_expense_invoice_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMInvoiceInfo.class)).stream().findAny().orElse(null);
                                 EMInvoiceInfoVO voFP = BeanUtil.copyProperties(data, EMInvoiceInfoVO.class);
+                                EMInvoiceInfoDetailVO emInvoiceInfoDetailVO = new EMInvoiceInfoDetailVO();
                                 if (voFP != null) {
                                     ControlProjectInfo projectInfo = jdbcTemplate.query("select name from c_control_project_info where id = " + voFP.getProjectId(), new BeanPropertyRowMapper<>(ControlProjectInfo.class)).stream().findAny().orElse(null);
                                     if (projectInfo != null) {
@@ -330,9 +331,19 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
                                         }
                                     }
                                     voFP.setInvoiceUserName(userMap.get(voFP.getInvoiceUserId()));
-                                    //TODO 发票抬头等信息
-
-                                    data = voFP;
+                                    emInvoiceInfoDetailVO.setEmInvoiceInfoVO(voFP);
+
+                                    List<ControlContractInfo> query = jdbcTemplate.query("select * from c_control_contract_info where project_id = " + voFP.getProjectId(), new BeanPropertyRowMapper<>(ControlContractInfo.class));
+                                    if (query.size() == 1) {
+                                        ControlContractInfo controlContractInfo = query.get(0);
+                                        if (controlContractInfo != null) {
+                                            ContractInvoiceInfoVO voFPDetail = BeanUtil.copyProperties(controlContractInfo, ContractInvoiceInfoVO.class);
+                                            if (voFPDetail != null) {
+                                                emInvoiceInfoDetailVO.setContractInvoiceInfoVO(voFPDetail);
+                                            }
+                                        }
+                                    }
+                                    data = emInvoiceInfoDetailVO;
                                 }
                                 break;