Преглед на файлове

维修日结算扣款配置

FengChaoYu преди 9 месеца
родител
ревизия
51373200bf

+ 0 - 13
mall-server-api/src/main/java/com/gree/mall/manager/bean/settle/repair/DailyBankAccountBean.java

@@ -1,13 +0,0 @@
-package com.gree.mall.manager.bean.settle.repair;
-
-import com.gree.mall.manager.plus.entity.SettleDailyBankAccount;
-import io.swagger.annotations.ApiModel;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-@EqualsAndHashCode(callSuper = true)
-@ApiModel
-@Data
-public class DailyBankAccountBean extends SettleDailyBankAccount {
-
-}

+ 46 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/settle/repair/DailyWithholdVO.java

@@ -0,0 +1,46 @@
+package com.gree.mall.manager.bean.settle.repair;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@ApiModel
+@ZfireField(tbName = "a")
+public class DailyWithholdVO {
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "暂扣费用id")
+    private String id;
+
+    @ApiModelProperty(value = "所属商户")
+    private String companyWechatName;
+
+    @ApiModelProperty(value = "费用名称")
+    private String name;
+
+    @ApiModelProperty(value = "扣除金额")
+    private BigDecimal amount;
+
+    @ApiModelProperty(value = "扣除比例")
+    private BigDecimal rate;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "创建人")
+    private Date createTime;
+
+    @ApiModelProperty(value = "创建时间")
+    private String createBy;
+
+    @ApiModelProperty(value = "修改人")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "修改时间")
+    private String updateBy;
+}

+ 9 - 0
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/CommonMapper.java

@@ -29,6 +29,7 @@ import com.gree.mall.manager.bean.settle.SettleExpenseVO;
 import com.gree.mall.manager.bean.settle.SettleMonthWagesVO;
 import com.gree.mall.manager.bean.settle.SettleMonthWagesWorkerVO;
 import com.gree.mall.manager.bean.settle.repair.DailyBankAccountVO;
+import com.gree.mall.manager.bean.settle.repair.DailyWithholdVO;
 import com.gree.mall.manager.bean.workorder.*;
 import com.gree.mall.manager.enums.UserTypeEnum;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
@@ -628,4 +629,12 @@ public interface CommonMapper {
      * @return
      */
     IPage<DailyBankAccountVO> repairSettleBankAccountList(Page page, @Param("ex") ZfireParamBean zfireParamBean);
+
+    /**
+     * 维修日结算扣款配置列表
+     * @param page
+     * @param zfireParamBean
+     * @return
+     */
+    IPage<DailyWithholdVO> repairSettleDailyWithholdList(Page page, @Param("ex") ZfireParamBean zfireParamBean);
 }

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

@@ -0,0 +1,75 @@
+package com.gree.mall.manager.controller.settle.repair;
+
+import cn.hutool.core.lang.TypeReference;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.settle.repair.DailyWithholdVO;
+import com.gree.mall.manager.helper.ResponseHelper;
+import com.gree.mall.manager.logic.settle.repair.DailyWithholdLogic;
+import com.gree.mall.manager.plus.entity.SettleDailyWithhold;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+@Slf4j
+@RestController
+@Api(value = "维修日结算扣款配置API", tags = {"维修日结算扣款配置API"})
+@RequestMapping(value = "/daily/withhold", produces = "application/json; charset=utf-8")
+@RequiredArgsConstructor
+public class DailyWithholdController {
+
+    private final DailyWithholdLogic dailyWithholdLogic;
+
+    @ZfireList
+    @PostMapping("/list")
+    @ApiOperation(value = "列表")
+    public ResponseHelper<IPage<DailyWithholdVO>> page(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) {
+        IPage<DailyWithholdVO> page = dailyWithholdLogic.page(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<DailyWithholdVO>() {
+        });
+    }
+
+
+    @PostMapping("/detail")
+    @ApiOperation("详情")
+    public ResponseHelper<SettleDailyWithhold> detail(
+            @ApiParam(required = true) @RequestParam String id
+    ){
+        SettleDailyWithhold detail = dailyWithholdLogic.detail(id);
+        return ResponseHelper.success(detail);
+    }
+
+    @PostMapping("/add")
+    @ApiOperation(value = "新增")
+    public ResponseHelper add(
+            @RequestBody SettleDailyWithhold dailyWithhold
+    ){
+        dailyWithholdLogic.add(dailyWithhold);
+        return ResponseHelper.success();
+    }
+
+    @PostMapping("/update")
+    @ApiOperation(value = "修改")
+    public ResponseHelper update(
+            @RequestBody SettleDailyWithhold dailyWithhold
+    ){
+        dailyWithholdLogic.update(dailyWithhold);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/delete")
+    @ApiOperation(value = "删除")
+    public ResponseHelper delete(
+            @ApiParam(required = true, value = "id") @RequestParam String id
+    ){
+        dailyWithholdLogic.delete(id);
+        return ResponseHelper.success();
+    }
+}

+ 59 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/settle/repair/DailyWithholdLogic.java

@@ -0,0 +1,59 @@
+package com.gree.mall.manager.logic.settle.repair;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.admin.AdminUserCom;
+import com.gree.mall.manager.bean.settle.repair.DailyWithholdVO;
+import com.gree.mall.manager.commonmapper.CommonMapper;
+import com.gree.mall.manager.exception.RemoteServiceException;
+import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.plus.entity.SettleDailyWithhold;
+import com.gree.mall.manager.plus.service.SettleDailyWithholdService;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class DailyWithholdLogic {
+
+    private final CommonLogic commonLogic;
+    private final CommonMapper commonMapper;
+    private final SettleDailyWithholdService settleDailyWithholdService;
+
+    public IPage<DailyWithholdVO> page(ZfireParamBean zfireParamBean) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        FieldUtils.supplyParam(zfireParamBean, DailyWithholdVO.class, adminUser);
+
+        return commonMapper.repairSettleDailyWithholdList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
+    }
+
+    public SettleDailyWithhold detail(String id) {
+        return settleDailyWithholdService.getById(id);
+    }
+
+    public void add(SettleDailyWithhold dailyWithhold) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        if (adminUser.getType() == 2) {
+            throw new RemoteServiceException("平台账号禁止操作");
+        }
+
+        dailyWithhold.setCompanyWechatId(adminUser.getAdminCompanyWechat().getCompanyWechatId())
+                .setCompanyWechatName(adminUser.getAdminCompanyWechat().getCompanyName())
+                .insert();
+    }
+
+
+    public void update(SettleDailyWithhold dailyWithhold) {
+        dailyWithhold.updateById();
+    }
+
+
+    public void delete(String id) {
+        settleDailyWithholdService.removeById(id);
+    }
+}

+ 12 - 0
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1053,6 +1053,18 @@
         </if>
         ${ex.orderBy}
     </select>
+    <select id="repairSettleDailyWithholdList"
+            resultType="com.gree.mall.manager.bean.settle.repair.DailyWithholdVO">
+        SELECT
+        ${ex.selected}
+        FROM
+        settle_daily_withhold a
+        ${ex.query}
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
 
 
 </mapper>