|
@@ -16,7 +16,6 @@ import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
|
|
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.constant.UpmsType;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.SysDictItem;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysUser;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.WmScorePackage;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.WmScorePackageSettleNote;
|
|
@@ -24,13 +23,11 @@ import com.qunzhixinxi.hnqz.admin.entity.dto.NotifyByOneSelfDTO;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageSettleInput;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.input.WmScorePackageSettleOutput;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.model.excel.SettlementProofModel;
|
|
|
-import com.qunzhixinxi.hnqz.admin.entity.model.excel.WmScorePackageSettleExcelModel;
|
|
|
+import com.qunzhixinxi.hnqz.admin.api.model.WmScorePackageSettleExcelModel;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.vo.SettleFinancialReviewSettleDetailVO;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.vo.SettleFinancialReviewVO;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.DelEnum;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.DeptPermissionEnum;
|
|
|
-import com.qunzhixinxi.hnqz.admin.enums.PackageFinishStatusEnum;
|
|
|
-import com.qunzhixinxi.hnqz.admin.enums.PackageTypeEnum;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.SettleStatusEnum;
|
|
|
import com.qunzhixinxi.hnqz.admin.enums.SubjectLocation;
|
|
|
import com.qunzhixinxi.hnqz.admin.mapper.WmScorePackageMapper;
|
|
@@ -46,6 +43,7 @@ import com.qunzhixinxi.hnqz.common.core.exception.BizException;
|
|
|
import com.qunzhixinxi.hnqz.common.core.util.R;
|
|
|
import com.qunzhixinxi.hnqz.common.ding.enums.DingEnum;
|
|
|
import com.qunzhixinxi.hnqz.common.log.annotation.SysLog;
|
|
|
+import com.qunzhixinxi.hnqz.common.security.annotation.Inner;
|
|
|
import com.qunzhixinxi.hnqz.common.security.service.HnqzUser;
|
|
|
import com.qunzhixinxi.hnqz.common.security.util.SecurityUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -58,6 +56,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
|
|
import org.springframework.security.access.AccessDeniedException;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -425,56 +424,10 @@ public class WmPayOffController {
|
|
|
@SysLog("积分包结算导出")
|
|
|
@GetMapping("/exportPackageSettle")
|
|
|
public List<WmScorePackageSettleExcelModel> exportPackageSettle(WmScorePackageSettleInput input) {
|
|
|
- input.setSendPackageDeptId(String.valueOf(SecurityUtils.getUser().getDeptId()));
|
|
|
- input.setPackageFinishStatus("1");
|
|
|
- input.setTypeid("4");
|
|
|
- input.setSettleFlag("1");
|
|
|
- List<WmScorePackageSettleOutput> list = wmScorePackageService.listAllPackageSettle(input);
|
|
|
- List<WmScorePackageSettleExcelModel> exportList = new ArrayList<>();
|
|
|
- if (CollectionUtil.isEmpty(list)) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
|
|
|
- // 获取所有税源地的发票类目信息
|
|
|
- List<SysDictItem> invoiceCategoryList =
|
|
|
- dictItemService.list(Wrappers.<SysDictItem>lambdaQuery()
|
|
|
- .in(SysDictItem::getType, SubjectLocation.getAllInvoices()));
|
|
|
- Map<String, Map<String, String>> collect = invoiceCategoryList.stream().collect(Collectors.groupingBy(SysDictItem::getType, Collectors.toMap(SysDictItem::getValue, SysDictItem::getLabel)));
|
|
|
-
|
|
|
- // 转换为导出实体
|
|
|
- for (int i = 0; i < list.size(); i++) {
|
|
|
- WmScorePackageSettleOutput settleOutput = list.get(i);
|
|
|
- WmScorePackageSettleExcelModel export = new WmScorePackageSettleExcelModel();
|
|
|
- export.setNumber(i + 1);
|
|
|
- export.setPackageSn(settleOutput.getPackageSn());
|
|
|
- export.setScorePackageName(settleOutput.getScorePackageName());
|
|
|
- export.setPackageType1(PackageTypeEnum.type1Resolve(settleOutput.getPackageType1()).getName2());
|
|
|
- export.setPackageEntName(settleOutput.getPackageEntName());
|
|
|
- export.setCreateTime(settleOutput.getCreateTime());
|
|
|
- export.setPackageFinishStatus(PackageFinishStatusEnum.resolve(settleOutput.getPackageFinishStatus()).getName());
|
|
|
- export.setScore(settleOutput.getScore());
|
|
|
-
|
|
|
- SubjectLocation subjectLocation = settleOutput.getSubjectLocation();
|
|
|
- if (subjectLocation != null) {
|
|
|
- export.setSubType(subjectLocation.getDescription());
|
|
|
- // 获取当前税源地的发票类目
|
|
|
- Map<String, String> subInvoice = collect.get(subjectLocation.getInvoiceType());
|
|
|
- if (subInvoice != null) {
|
|
|
- // 根据发票类目value获取发票类目名称
|
|
|
- String cate = String.valueOf(settleOutput.getInvoiceCategory());
|
|
|
- String invoice = subInvoice.getOrDefault(cate, "");
|
|
|
- export.setInvoiceCategory(invoice);
|
|
|
- }
|
|
|
- }
|
|
|
- export.setUserNames(settleOutput.getUserNames());
|
|
|
- export.setSettleAmount(settleOutput.getSettleAmount());
|
|
|
- export.setActualAmount(settleOutput.getActualAmount());
|
|
|
- export.setSettleStatus(SettleStatusEnum.resolve(settleOutput.getSettleStatus()).getName());
|
|
|
- export.setBelongDate(settleOutput.getBelongDate());
|
|
|
- exportList.add(export);
|
|
|
- }
|
|
|
+ input.setSendPackageDeptId(String.valueOf(SecurityUtils.getUser().getDeptId()));
|
|
|
|
|
|
- return exportList;
|
|
|
+ return wmPayOffService.exportPackageSettle(input);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -489,55 +442,40 @@ public class WmPayOffController {
|
|
|
public List<WmScorePackageSettleExcelModel> exportPackageSettleByMAH(WmScorePackageSettleInput input) {
|
|
|
|
|
|
input.setMahSettleDeptId(SecurityUtils.getUser().getDeptId());
|
|
|
- input.setPackageFinishStatus("1");
|
|
|
- input.setTypeid("4");
|
|
|
- input.setSettleFlag("1");
|
|
|
- List<WmScorePackageSettleOutput> list = wmScorePackageService.listPackageSettleList(new Page<>(1, 499), input).getRecords();
|
|
|
- List<WmScorePackageSettleExcelModel> exportList = new ArrayList<>();
|
|
|
- if (CollectionUtil.isEmpty(list)) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
|
|
|
- // 获取所有税源地的发票类目信息
|
|
|
- List<SysDictItem> invoiceCategoryList =
|
|
|
- dictItemService.list(Wrappers.<SysDictItem>lambdaQuery()
|
|
|
- .in(SysDictItem::getType, SubjectLocation.getAllInvoices()));
|
|
|
- Map<String, Map<String, String>> collect = invoiceCategoryList.stream().collect(Collectors.groupingBy(SysDictItem::getType, Collectors.toMap(SysDictItem::getValue, SysDictItem::getLabel)));
|
|
|
-
|
|
|
- // 转换为导出实体
|
|
|
- for (int i = 0; i < list.size(); i++) {
|
|
|
- WmScorePackageSettleOutput settleOutput = list.get(i);
|
|
|
- WmScorePackageSettleExcelModel export = new WmScorePackageSettleExcelModel();
|
|
|
- export.setNumber(i + 1);
|
|
|
- export.setPackageSn(settleOutput.getPackageSn());
|
|
|
- export.setScorePackageName(settleOutput.getScorePackageName());
|
|
|
- export.setPackageType1(PackageTypeEnum.type1Resolve(settleOutput.getPackageType1()).getName2());
|
|
|
- export.setPackageEntName(settleOutput.getPackageEntName());
|
|
|
- export.setCreateTime(settleOutput.getCreateTime());
|
|
|
- export.setPackageFinishStatus(PackageFinishStatusEnum.resolve(settleOutput.getPackageFinishStatus()).getName());
|
|
|
- export.setScore(settleOutput.getScore());
|
|
|
-
|
|
|
- SubjectLocation subjectLocation = settleOutput.getSubjectLocation();
|
|
|
- if (subjectLocation != null) {
|
|
|
- export.setSubType(subjectLocation.getDescription());
|
|
|
- // 获取当前税源地的发票类目
|
|
|
- Map<String, String> subInvoice = collect.get(subjectLocation.getInvoiceType());
|
|
|
- if (subInvoice != null) {
|
|
|
- // 根据发票类目value获取发票类目名称
|
|
|
- String cate = String.valueOf(settleOutput.getInvoiceCategory());
|
|
|
- String invoice = subInvoice.getOrDefault(cate, "");
|
|
|
- export.setInvoiceCategory(invoice);
|
|
|
- }
|
|
|
- }
|
|
|
- export.setUserNames(settleOutput.getUserNames());
|
|
|
- export.setSettleAmount(settleOutput.getSettleAmount());
|
|
|
- export.setActualAmount(settleOutput.getActualAmount());
|
|
|
- export.setSettleStatus(SettleStatusEnum.resolve(settleOutput.getSettleStatus()).getName());
|
|
|
- export.setBelongDate(settleOutput.getBelongDate());
|
|
|
- exportList.add(export);
|
|
|
- }
|
|
|
+ return wmPayOffService.exportPackageSettleByMAH(input);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 结算包结算导出-内部
|
|
|
+ *
|
|
|
+ * @param deptId 企业id
|
|
|
+ * @return excel模型
|
|
|
+ */
|
|
|
+ @Inner
|
|
|
+ @SysLog("积分包结算导出-内部")
|
|
|
+ @GetMapping("/exportPackageSettleForInner/{deptId}")
|
|
|
+ public List<WmScorePackageSettleExcelModel> exportPackageSettle(@PathVariable("deptId") Integer deptId) {
|
|
|
+ WmScorePackageSettleInput input = new WmScorePackageSettleInput();
|
|
|
+ input.setSendPackageDeptId(String.valueOf(deptId));
|
|
|
+
|
|
|
+ // TODO 添加查询条件 查指定日期
|
|
|
+ return wmPayOffService.exportPackageSettle(input);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * MAH结算包结算导出-内部
|
|
|
+ *
|
|
|
+ * @param deptId 企业id
|
|
|
+ * @return excel模型
|
|
|
+ */
|
|
|
+ @SysLog("积分包结算导出")
|
|
|
+ @GetMapping("/exportPackageSettleByMAHForInner/{deptId}")
|
|
|
+ public List<WmScorePackageSettleExcelModel> exportPackageSettleByMAH(@PathVariable("deptId") Integer deptId) {
|
|
|
+ WmScorePackageSettleInput input = new WmScorePackageSettleInput();
|
|
|
+ input.setMahSettleDeptId(deptId);
|
|
|
|
|
|
- return exportList;
|
|
|
+ return wmPayOffService.exportPackageSettleByMAH(input);
|
|
|
}
|
|
|
|
|
|
/**
|