Browse Source

no message

FengChaoYu 8 months ago
parent
commit
46bef697df

+ 12 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/settle/repair/DailyImportSummaryController.java

@@ -479,4 +479,16 @@ public class DailyImportSummaryController {
     public ResponseHelper<DailyCountBean> repairAllListExport() throws Exception {
         return ResponseHelper.success(dailyImportSummaryLogic.repairAllCount());
     }
+
+    @GetMapping("/worker/detail/export")
+    @ApiOperation(value = "日结师傅汇总详情-导出")
+    public void workerDetailExport(
+            @ApiParam(required = true, value = "日结记录ID") @RequestParam String issueSalaryId,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        IPage<DailyWorkerIssueSalaryBean> page = dailyImportSummaryLogic.workerDetailList(issueSalaryId, 1, -1);
+        ExcelData excelData = dailyImportSummaryLogic.workerDetailExport(page.getRecords());
+        ExcelUtils.exportExcel(request, response, "日结师傅汇总详情.xlsx", excelData);
+    }
 }

+ 11 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/user/UserLogic.java

@@ -443,6 +443,12 @@ public class UserLogic {
 
     @Transactional
     public void saveWebsitUser(String websitId, User user, String bankAccount, String workerNumber, String remark) {
+        // 用户师傅编号不为空并且师傅编号与传入师傅编号不一致,抛错
+        if (StringUtils.isNotBlank(user.getWorkerNumber())
+                && !StringUtils.equals(user.getWorkerNumber(), workerNumber)) {
+            throw new RemoteServiceException("用户师傅编号与本次传入师傅编号不一致");
+        }
+
         // 先清空网点师傅记录
         websitUserService.lambdaUpdate()
                 .eq(WebsitUser::getUserId, user.getUserId())
@@ -459,6 +465,11 @@ public class UserLogic {
         websitUser.setBankAccount(bankAccount);
         websitUser.setWorkerNumber(workerNumber);
         websitUser.insert();
+
+        if (StringUtils.isBlank(user.getWorkerNumber())) {
+            user.setWorkerNumber(workerNumber)
+                    .updateById();
+        }
     }