Browse Source

11.11 导出修改

sunjiabei/feature-20251021102635-银行接口
huangqizhen 2 weeks ago
parent
commit
27c39a7094
  1. 15
      src/main/java/com/example/demo/controller/cash/CashCollectionController.java
  2. 5
      src/main/java/com/example/demo/serviceImpl/coin/ExportExcelServiceImpl.java
  3. 2
      src/main/resources/mapper/AuditMapper.xml

15
src/main/java/com/example/demo/controller/cash/CashCollectionController.java

@ -111,6 +111,21 @@ public class CashCollectionController {
return Result.error(e.getMessage()); return Result.error(e.getMessage());
}} }}
@PostMapping("/export")
public Result export(@RequestBody Page page) throws Exception {
try {
if (ObjectUtils.isEmpty(page.getPageNum())) {
return Result.error("页码数为空!");
}
if (ObjectUtils.isEmpty(page.getPageSize())) {
return Result.error("页大小为空!");
}
return Result.success(cashCollectionService.selectCollection(page.getPageNum(), page.getPageSize(),page.getCashCollection()));
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
//补全手续费等 //补全手续费等
@PostMapping("/complete") @PostMapping("/complete")
public Result complete(@RequestBody CashCollection cashRecord) { public Result complete(@RequestBody CashCollection cashRecord) {

5
src/main/java/com/example/demo/serviceImpl/coin/ExportExcelServiceImpl.java

@ -8,6 +8,7 @@ import com.example.demo.Util.ExcelUploadUtil;
import com.example.demo.Util.JWTUtil; import com.example.demo.Util.JWTUtil;
import com.example.demo.controller.bean.BeanConsumeController; import com.example.demo.controller.bean.BeanConsumeController;
import com.example.demo.controller.bean.BeanRechargeController; import com.example.demo.controller.bean.BeanRechargeController;
import com.example.demo.controller.cash.CashCollectionController;
import com.example.demo.controller.cash.CashRefundController; import com.example.demo.controller.cash.CashRefundController;
import com.example.demo.controller.coin.ConsumeController; import com.example.demo.controller.coin.ConsumeController;
import com.example.demo.controller.coin.GoldDetailController; import com.example.demo.controller.coin.GoldDetailController;
@ -85,6 +86,8 @@ public class ExportExcelServiceImpl implements ExportExcelService {
private AuthenticationManager authenticationManager; private AuthenticationManager authenticationManager;
@Autowired @Autowired
private CashRefundController cashRefundController; private CashRefundController cashRefundController;
@Autowired
private CashCollectionController cashCollectionController;
// 每页查询的数据量 // 每页查询的数据量
private static final int PAGE_SIZE = 5000; private static final int PAGE_SIZE = 5000;
@Autowired @Autowired
@ -294,7 +297,7 @@ public class ExportExcelServiceImpl implements ExportExcelService {
JsonNode beanRechargeNode = requestDataNode.path("cashCollection"); JsonNode beanRechargeNode = requestDataNode.path("cashCollection");
CashCollection cashCollection = objectMapper.treeToValue(beanRechargeNode, CashCollection.class); CashCollection cashCollection = objectMapper.treeToValue(beanRechargeNode, CashCollection.class);
page.setCashCollection(cashCollection); page.setCashCollection(cashCollection);
return cashRefundController.export(page);
return cashCollectionController.export(page);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

2
src/main/resources/mapper/AuditMapper.xml

@ -169,7 +169,7 @@
select admin_name from admin where id = #{auditId} select admin_name from admin where id = #{auditId}
</select> </select>
<select id="getNamesByIds" resultType="map">
<select id="getNamesByIds" resultType="com.example.demo.domain.entity.Admin">
select id, admin_name from admin select id, admin_name from admin
<where> <where>
<if test="submitterIds != null and submitterIds.size() > 0"> <if test="submitterIds != null and submitterIds.size() > 0">

Loading…
Cancel
Save