Browse Source

Merge remote-tracking branch 'origin/intex' into intex

intex
liuchen864 3 days ago
parent
commit
d74c9804a8
  1. 23
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/balance/BalanceController.java
  2. 138
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/customerStatement/CustomerToolApportStatementDetailController.java
  3. 10
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierToolApportStatement/SupplierToolApportStatementDetailController.java
  4. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierToolApportStatement/SupplierToolApportStatementMainController.java
  5. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customerToolApportStatementForecast/CustomerToolApportStatementForecastMainServiceImpl.java
  6. 8
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierToolApportStatement/SupplierToolApportStatementMainServiceImpl.java
  7. 2
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierinvoiceRequest/SupplierinvoiceRequestDetailServiceImpl.java

23
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/balance/BalanceController.java

@ -22,15 +22,11 @@ import com.win.module.wms.dal.dataobject.balance.BalanceDO;
import com.win.module.wms.dal.dataobject.businesstype.BusinesstypeDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.packageMassage.PackageDO;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchasereceiptRecordDetailDO;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchasereceiptRecordMainDO;
import com.win.module.wms.dal.dataobject.supplier.SupplierDO;
import com.win.module.wms.dal.mysql.areabasic.AreabasicMapper;
import com.win.module.wms.dal.mysql.balance.BalanceMapper;
import com.win.module.wms.dal.mysql.itembasic.ItembasicMapper;
import com.win.module.wms.dal.mysql.packageMassage.PackageMapper;
import com.win.module.wms.dal.mysql.purchasereceiptRecord.PurchasereceiptRecordDetailMapper;
import com.win.module.wms.dal.mysql.purchasereceiptRecord.PurchasereceiptRecordMainMapper;
import com.win.module.wms.dal.mysql.supplier.SupplierMapper;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.balance.BalanceService;
@ -41,7 +37,6 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -465,9 +460,27 @@ public class BalanceController {
public CommonResult<PageResult<BalanceRespVO>> getBalancePageBusinessTypeByItemType(@Valid BalancePageReqVO pageVO) {
PageResult<BalanceDO> pageResult = balanceService.getBalancePageBusinessTypeByItemType(pageVO);
PageResult<BalanceRespVO> result = BalanceConvert.INSTANCE.convertPage(pageResult);
Set<String> itemCodes = new HashSet<>();
for (BalanceRespVO vo : result.getList()) {
// 后端创建个字段作为前端展示的虚拟字段
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
itemCodes.add(vo.getItemCode());
}
//批量获取物料信息
LambdaQueryWrapperX<ItembasicDO> lambdaQueryWrapperX = new LambdaQueryWrapperX<>();
lambdaQueryWrapperX.eq(ItembasicDO::getAvailable, "TRUE");
lambdaQueryWrapperX.inIfPresent(ItembasicDO::getCode,itemCodes);
List<ItembasicDO> itembasicList = itembasicMapper.selectList(lambdaQueryWrapperX);
Map<String, ItembasicDO> itembasicMap = itembasicList.stream().collect(Collectors.toMap(ItembasicDO::getCode, p -> p));
for (BalanceRespVO vo : result.getList()) {
if(itembasicMap.get(vo.getItemCode()) != null){
ItembasicDO itembasicDO = itembasicMap.get(vo.getItemCode());
vo.setItemDesc1(itembasicDO.getDesc1());
vo.setItemDesc2(itembasicDO.getDesc2());
vo.setItemName(itembasicDO.getName());
vo.setItemType(itembasicDO.getType());
}
}
return success(result);
}

138
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/customerStatement/CustomerToolApportStatementDetailController.java

@ -120,6 +120,37 @@ public class CustomerToolApportStatementDetailController {
return success(result);
}
@GetMapping("/pageDetail")
@Operation(summary = "获得客户模具分摊对账单明细表(WMS)分页")
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
public CommonResult<PageResult<CustomerToolApportStatementDetailRespVO>> getCustomerToolApportStatementDetailPageDetail(@Valid CustomerToolApportStatementDetailPageReqVO pageVO) {
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailPage(pageVO);
PageResult<CustomerToolApportStatementDetailRespVO> result = CustomerToolApportStatementDetailConvert.INSTANCE.convertPage(pageResult);
Map<Long, String> userNicknameMap = new HashMap<>();
//收集所有需要查询的用户ID
Set<Long> userIds = new HashSet<>();
result.getList().forEach(vo -> {
userIds.add(Long.valueOf(vo.getCreator()));
userIds.add(Long.valueOf(vo.getUpdater()));
});
if(!userIds.isEmpty()){
//批量获取用户信息
List<AdminUserRespDTO> userList = userApi.getUserList(userIds);
if(!userList.isEmpty()){
userNicknameMap = userList.stream().collect(Collectors.toMap(AdminUserRespDTO::getId, AdminUserRespDTO::getNickname));
}
}
for(CustomerToolApportStatementDetailRespVO en:result.getList()){
if(userNicknameMap.containsKey(Long.valueOf(en.getCreator()))){
en.setCreator(userNicknameMap.get(Long.valueOf(en.getCreator())));
}
if(userNicknameMap.containsKey(Long.valueOf(en.getUpdater()))){
en.setUpdater(userNicknameMap.get(Long.valueOf(en.getUpdater())));
}
}
return success(result);
}
@GetMapping("/pageGroup")
@Operation(summary = "获得客户模具分摊对账单明细分组(WMS)分页")
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
@ -161,11 +192,92 @@ public class CustomerToolApportStatementDetailController {
return success(result);
}
@PostMapping("/senior")
@Operation(summary = "高级搜索获得检验任务主分页")
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
public CommonResult<PageResult<CustomerToolApportStatementDetailRespVO>> getCustomerToolApportStatementDetailSenior(@Valid @RequestBody CustomConditions conditions) {
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSenior(conditions);
PageResult<CustomerToolApportStatementDetailRespVO> result = CustomerToolApportStatementDetailConvert.INSTANCE.convertPage(pageResult);
for(CustomerToolApportStatementDetailRespVO en:result.getList()){
String customerStatementNumber = en.getCustomerStatementNumber();
List<CustomerStatementMainDO> mainDOS = customerStatementMainMapper.selectList("number", customerStatementNumber);
if(!mainDOS.isEmpty()){
String customerName = mainDOS.get(0).getCustomerName();
String customerCode = mainDOS.get(0).getCustomerCode();
en.setCustomerName(customerName);
en.setCustomerCode(customerCode);
}
}
Map<Long, String> userNicknameMap = new HashMap<>();
//收集所有需要查询的用户ID
Set<Long> userIds = new HashSet<>();
result.getList().forEach(vo -> {
userIds.add(Long.valueOf(vo.getCreator()));
userIds.add(Long.valueOf(vo.getUpdater()));
});
if(!userIds.isEmpty()){
//批量获取用户信息
List<AdminUserRespDTO> userList = userApi.getUserList(userIds);
if(!userList.isEmpty()){
userNicknameMap = userList.stream().collect(Collectors.toMap(AdminUserRespDTO::getId, AdminUserRespDTO::getNickname));
}
}
for(CustomerToolApportStatementDetailRespVO en:result.getList()){
if(userNicknameMap.containsKey(Long.valueOf(en.getCreator()))){
en.setCreator(userApi.getUserNickname(en.getCreator()));
}
if(userNicknameMap.containsKey(Long.valueOf(en.getUpdater()))){
en.setUpdater(userApi.getUserNickname(en.getUpdater()));
}
}
return success(result);
}
@PostMapping("/seniorDetail")
@Operation(summary = "高级搜索对账单明细")
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
public CommonResult<PageResult<CustomerToolApportStatementDetailRespVO>> getCustomerToolApportStatementDetailSeniorDetail(@Valid @RequestBody CustomConditions conditions) {
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSenior(conditions);
PageResult<CustomerToolApportStatementDetailRespVO> result = CustomerToolApportStatementDetailConvert.INSTANCE.convertPage(pageResult);
for(CustomerToolApportStatementDetailRespVO en:result.getList()){
String customerStatementNumber = en.getCustomerStatementNumber();
List<CustomerStatementMainDO> mainDOS = customerStatementMainMapper.selectList("number", customerStatementNumber);
if(!mainDOS.isEmpty()){
String customerName = mainDOS.get(0).getCustomerName();
String customerCode = mainDOS.get(0).getCustomerCode();
en.setCustomerName(customerName);
en.setCustomerCode(customerCode);
}
}
Map<Long, String> userNicknameMap = new HashMap<>();
//收集所有需要查询的用户ID
Set<Long> userIds = new HashSet<>();
result.getList().forEach(vo -> {
userIds.add(Long.valueOf(vo.getCreator()));
userIds.add(Long.valueOf(vo.getUpdater()));
});
if(!userIds.isEmpty()){
//批量获取用户信息
List<AdminUserRespDTO> userList = userApi.getUserList(userIds);
if(!userList.isEmpty()){
userNicknameMap = userList.stream().collect(Collectors.toMap(AdminUserRespDTO::getId, AdminUserRespDTO::getNickname));
}
}
for(CustomerToolApportStatementDetailRespVO en:result.getList()){
if(userNicknameMap.containsKey(Long.valueOf(en.getCreator()))){
en.setCreator(userApi.getUserNickname(en.getCreator()));
}
if(userNicknameMap.containsKey(Long.valueOf(en.getUpdater()))){
en.setUpdater(userApi.getUserNickname(en.getUpdater()));
}
}
return success(result);
}
@PostMapping("/seniorGroup")
@Operation(summary = "高级搜索获得检验任务主分页")
//@PreAuthorize("@ss.hasPermission('wms:customer-tool-apport-statement-detail:query')")
public CommonResult<PageResult<CustomerToolApportStatementDetailRespVO>> getCustomerToolApportStatementDetailSeniorGroup(@Valid @RequestBody CustomConditions conditions) {
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSenior(conditions);
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSeniorGroup(conditions);
PageResult<CustomerToolApportStatementDetailRespVO> result = CustomerToolApportStatementDetailConvert.INSTANCE.convertPage(pageResult);
for(CustomerToolApportStatementDetailRespVO en:result.getList()){
String customerStatementNumber = en.getCustomerStatementNumber();
@ -217,7 +329,7 @@ public class CustomerToolApportStatementDetailController {
ExcelUtils.write(response, "客户模具分摊对账单明细表(WMS).xls", "数据", CustomerToolApportStatementDetailExcelVO.class, resultList);
}
@GetMapping("/export-excel-group")
@GetMapping("/export-excel-detail")
@Operation(summary = "模具分摊对账单记录导出客户模具分摊对账单明细表(WMS) Excel")
//@PreAuthorize("@ss.hasPermission('wms:customer-statement-main:export')")
@OperateLog(type = EXPORT)
@ -232,7 +344,27 @@ public class CustomerToolApportStatementDetailController {
ExcelUtils.write(response, "客户模具分摊对账单明细表(WMS).xls", "数据", CustomerToolApportStatementRecordDetailExcelVO.class, resultList);
}
@PostMapping("/export-excel-senior-group")
@PostMapping("/export-excel-senior")
@Operation(summary = "模具分摊对账单记录导出高级搜索Excel")
//@PreAuthorize("@ss.hasPermission('wms:customer-statement-main:export')")
@OperateLog(type = EXPORT)
public void exportSeniorExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
conditions.setPageSize(Integer.MAX_VALUE);
conditions.setPageNo(1);
List<CustomConditions.Condition> conditionList = conditions.getFilters();
CustomConditions.Condition condition = new CustomConditions.Condition();
condition.setColumn("status");//有效数据
condition.setAction("==");
condition.setValue("0");
conditionList.add(condition);
PageResult<CustomerToolApportStatementDetailDO> pageResult = customerToolApportStatementDetailService.getCustomerToolApportStatementDetailSenior(conditions);
List<CustomerToolApportStatementDetailDO> list = pageResult.getList();
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<CustomerToolApportStatementRecordDetailExcelVO> resultList = this.getGroupExcelVo(list, mapDropDown);
ExcelUtils.write(response, "客户对账单主信息表(WMS).xls", "数据", CustomerToolApportStatementRecordDetailExcelVO.class, resultList);
}
@PostMapping("/export-excel-senior-detail")
@Operation(summary = "模具分摊对账单记录导出高级搜索Excel")
//@PreAuthorize("@ss.hasPermission('wms:customer-statement-main:export')")
@OperateLog(type = EXPORT)

10
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierToolApportStatement/SupplierToolApportStatementDetailController.java

@ -40,14 +40,14 @@ public class SupplierToolApportStatementDetailController {
@PostMapping("/create")
@Operation(summary = "创建供应商模具分摊主表子表(WMS)")
@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-detail:create')")
//@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-detail:create')")
public CommonResult<Long> createSupplierToolApportStatementDetail(@Valid @RequestBody SupplierToolApportStatementDetailCreateReqVO createReqVO) {
return success(supplierToolApportStatementDetailService.createSupplierToolApportStatementDetail(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新供应商模具分摊主表子表(WMS)")
@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-detail:update')")
//@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-detail:update')")
public CommonResult<Boolean> updateSupplierToolApportStatementDetail(@Valid @RequestBody SupplierToolApportStatementDetailUpdateReqVO updateReqVO) {
int result = supplierToolApportStatementDetailService.updateSupplierToolApportStatementDetail(updateReqVO);
return success(result > 0);
@ -56,7 +56,7 @@ public class SupplierToolApportStatementDetailController {
@DeleteMapping("/delete")
@Operation(summary = "删除供应商模具分摊主表子表(WMS)")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-detail:delete')")
//@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-detail:delete')")
public CommonResult<Boolean> deleteSupplierToolApportStatementDetail(@RequestParam("id") Long id) {
int result = supplierToolApportStatementDetailService.deleteSupplierToolApportStatementDetail(id);
return success(result > 0);
@ -89,7 +89,7 @@ public class SupplierToolApportStatementDetailController {
@GetMapping("/export-excel")
@Operation(summary = "导出供应商模具分摊主表子表(WMS) Excel")
@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-main:export')")
//@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-main:export')")
@OperateLog(type = EXPORT)
public void exportSupplierToolApportStatementDetailExcel(@Valid SupplierToolApportStatementDetailPageReqVO pageVO, HttpServletResponse response) throws IOException {
pageVO.setPageNo(1);
@ -103,7 +103,7 @@ public class SupplierToolApportStatementDetailController {
@PostMapping("/export-excel-senior")
@Operation(summary = "导出高级搜索Excel")
@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-main:export')")
//@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-main:export')")
@OperateLog(type = EXPORT)
public void exportSeniorExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
conditions.setPageSize(Integer.MAX_VALUE);

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierToolApportStatement/SupplierToolApportStatementMainController.java

@ -328,7 +328,7 @@ public class SupplierToolApportStatementMainController {
@Parameters({
@Parameter(name = "id", description = "对账单id", required = true)
})
@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-main:publish')")
//@PreAuthorize("@ss.hasPermission('wms:supplier-tool-apport-statement-main:publish')")
@Idempotent(timeout = 10, message = "请勿重复提交")
public CommonResult<Boolean> publish(Long id) {
Integer i = supplierToolApportStatementMainService.publish(id);

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/customerToolApportStatementForecast/CustomerToolApportStatementForecastMainServiceImpl.java

@ -123,7 +123,7 @@ public class CustomerToolApportStatementForecastMainServiceImpl implements Custo
@Override
public PageResult<CustomerToolApportStatementForecastMainDO> getCustomerToolApportStatementForecastMainPage(CustomerToolApportStatementForecastMainPageReqVO pageReqVO) {
if (pageReqVO.getCustomerCode().isEmpty() || StringUtil.isNotEmpty(pageReqVO.getCustomerCode().get(0))) {
if (pageReqVO.getCustomerCode()==null || pageReqVO.getCustomerCode().isEmpty()) {
pageReqVO.setCustomerCode(null);
}
return customerToolApportStatementForecastMainMapper.selectPage(pageReqVO);

8
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierToolApportStatement/SupplierToolApportStatementMainServiceImpl.java

@ -127,6 +127,7 @@ public class SupplierToolApportStatementMainServiceImpl implements SupplierToolA
}
@Override
@Transactional
public Map<String, Object> importSupplierToolApportStatementMainList(List<SupplierToolApportStatementMainImportExcelVO> datas, String yearsMonthStr, String supplierCode) throws Exception {
Map<String, Object> returnMap = new HashMap<>();
String status = "1";//1:当前客户code+年月数据库库没有非作废的数据 2:有数据且状态为未发布 3有数据状态为已发布
@ -215,6 +216,11 @@ public class SupplierToolApportStatementMainServiceImpl implements SupplierToolA
trendsApi.createTrends(mainDO.getId(), "supplier_tool_apport_statement_main", null,"导入供应商模具分摊费用模版数据", JSONUtil.toJsonStr(mainDO), TrendsTypeEnum.STATEMENT_IMPORT, String.valueOf(getLoginUserId()));
//校验之后把导入的数据转成明细数据
List<SupplierToolApportStatementDetailDO> detailDOS = SupplierToolApportStatementDetailConvert.INSTANCE.convertList03(datas);
for(SupplierToolApportStatementDetailDO en: detailDOS){
en.setNumber(number);//number
en.setStatus("0");//未分摊
en.setMasterId(mainDO.getId());
}
//批量操作
supplierToolApportStatementDetailMapper.insertBatch(detailDOS);
}
@ -277,7 +283,7 @@ public class SupplierToolApportStatementMainServiceImpl implements SupplierToolA
if(mainDO==null){
throw exception(SUPPLIER_STATEMENT_MAIN_NO_EXIST);
}
if("1".equals(mainDO.getStatus())){//发布状态作废需要校验明细都是为为分摊状态0否则不允许作废
if("1".equals(mainDO.getStatus())){//发布状态回退需要校验明细都是为为分摊状态0否则不允许作废
List<SupplierToolApportStatementDetailDO> detailDOS = supplierToolApportStatementDetailMapper.selectListByMasterId(mainDO.getId());
for(SupplierToolApportStatementDetailDO en:detailDOS){
if("1".equals(en.getStatus())){//有分摊的数据提示不允许作废

2
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierinvoiceRequest/SupplierinvoiceRequestDetailServiceImpl.java

@ -784,7 +784,7 @@ public class SupplierinvoiceRequestDetailServiceImpl implements SupplierinvoiceR
barbasicDO.setItemDesc(packageDO.getItemDesc1());
barbasicDO.setPoNumber(packageDO.getPoNumber());
barbasicDO.setPoLine(packageDO.getPoLine());
barbasicDO.setSupplierCode(packageDO.getSupplierCode());
barbasicDO.setSupplierCode(packageDO.getSupplierItemCode());
barbasicDO.setPrintTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
barbasicDO.setPackUnit(packageDO.getPackUnit());
barbasicDO.setSupplierBatch(packageDO.getSupplierBatch());//供应商批次

Loading…
Cancel
Save