8) 采购退货 bugfix
This commit is contained in:
parent
3e9ea3c6cc
commit
8b86b1bca3
@ -23,8 +23,12 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.cim.idm.service.Impl.InvoiceServiceImpl;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api("单据接口")
|
||||
@RestController
|
||||
@ -59,8 +63,12 @@ public class PurchaseReturnController {
|
||||
|
||||
try {
|
||||
List<PurchaseReturnDto> purchaseReturnList =
|
||||
purchaseReturnServiceDao.getPurchaseReturnList(siteName, user, receiverequestname);
|
||||
return AjaxResult.me().setResultObj(purchaseReturnList);
|
||||
purchaseReturnService.getPurchaseReturnList(siteName, user, receiverequestname, erpfactory);
|
||||
//将List<PurchaseReturnDto>的key值转换成大写工具类
|
||||
List<Map<String, Object>> upperCaseList = purchaseReturnList.stream()
|
||||
.map(dto -> toUpperCaseMap(dto))
|
||||
.collect(Collectors.toList());
|
||||
return AjaxResult.me().setResultObj(upperCaseList);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.me().setErrorCode(500).setMessage("未找到对应的数据!");
|
||||
}
|
||||
@ -108,7 +116,10 @@ public class PurchaseReturnController {
|
||||
|
||||
try {
|
||||
List<PurchaseReturnDto> purchaseReturnInfo =
|
||||
purchaseReturnServiceDao.getPurchaseReturnInfo(siteName, materialReceiveRequest.getUser(), receiverequestname);
|
||||
purchaseReturnService.getPurchaseReturnInfo(siteName, materialReceiveRequest.getUser(), receiverequestname);
|
||||
List<Map<String, Object>> upperCaseList = purchaseReturnInfo.stream()
|
||||
.map(dto -> toUpperCaseMap(dto))
|
||||
.collect(Collectors.toList());
|
||||
return AjaxResult.me().setResultObj(purchaseReturnInfo);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.me().setErrorCode(500).setMessage("未找到对应的数据!");
|
||||
@ -364,4 +375,18 @@ public class PurchaseReturnController {
|
||||
}
|
||||
return AjaxResult.me().setResultObj(null);
|
||||
}
|
||||
|
||||
private Map<String, Object> toUpperCaseMap(PurchaseReturnDto dto) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//采用循环的方式将dto的key值转换成大写放到map
|
||||
for (Field field : dto.getClass().getDeclaredFields()) {
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
map.put(field.getName().toUpperCase(), field.get(dto));
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ public interface PurchaseReturnServiceDao {
|
||||
//获取库存BoxList
|
||||
public List<MaterialPacking> getPurchaseReturnBoxList(@Param("siteName") String siteName, @Param("receiverequestname") String receiverequestname) throws Exception;
|
||||
|
||||
public List<PurchaseReturnDto> getPurchaseReturnList(@Param("siteName") String siteName, @Param("user") String user, @Param("receiverequestname") String receiverequestname) throws Exception;
|
||||
public List<PurchaseReturnDto> getPurchaseReturnList(@Param("siteName") String siteName, @Param("user") String user, @Param("receiverequestname") String receiverequestname, @Param("erpFactory") String erpFactory) throws Exception;
|
||||
|
||||
public List<PurchaseReturnDto> getPurchaseReturnInfo(@Param("siteName") String siteName, @Param("user") String user, @Param("receiverequestname") String receiverequestname) throws Exception;
|
||||
|
||||
|
@ -2,11 +2,13 @@ package com.cim.idm.service.Impl;
|
||||
|
||||
import com.cim.idm.dao.PurchaseReturnServiceDao;
|
||||
import com.cim.idm.dao.ToSapDao;
|
||||
import com.cim.idm.model.PurchaseReturnDto;
|
||||
import com.cim.idm.service.PurchaseReturnService;
|
||||
import com.cim.idm.service.impl.ToSAPServiceImpl;
|
||||
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -29,8 +31,9 @@ public class PurchaseReturnServiceImpl implements PurchaseReturnService {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String getPurchaseReturnList(String siteName, String user, String receiverequestname) throws Exception {
|
||||
return "";
|
||||
@Transactional
|
||||
public List<PurchaseReturnDto> getPurchaseReturnList(String siteName, String user, String receiverequestname,String erpFactory) throws Exception {
|
||||
return purchaseReturnServiceDao.getPurchaseReturnList(siteName, user, receiverequestname,erpFactory);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -41,8 +44,9 @@ public class PurchaseReturnServiceImpl implements PurchaseReturnService {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String getPurchaseReturnInfo(String siteName, String user, String receiverequestname) throws Exception {
|
||||
return "";
|
||||
@Transactional
|
||||
public List<PurchaseReturnDto> getPurchaseReturnInfo(String siteName, String user, String receiverequestname) throws Exception {
|
||||
return purchaseReturnServiceDao.getPurchaseReturnInfo(siteName, user, receiverequestname);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,6 +86,7 @@ public class PurchaseReturnServiceImpl implements PurchaseReturnService {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public String completeReceiveRequest(String siteName, String user, String receiverequestname) throws Exception {
|
||||
//查找需要过账的采购退库信息
|
||||
List<MaterialPacking> purchaseReturnBoxList = purchaseReturnServiceDao.getPurchaseReturnBoxList(siteName, receiverequestname);
|
||||
|
@ -1,10 +1,14 @@
|
||||
package com.cim.idm.service;
|
||||
|
||||
import com.cim.idm.model.PurchaseReturnDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PurchaseReturnService {
|
||||
|
||||
public String getPurchaseReturnList(String siteName, String user, String receiverequestname) throws Exception;
|
||||
public List<PurchaseReturnDto> getPurchaseReturnList(String siteName, String user, String receiverequestname, String erpFactory) throws Exception;
|
||||
|
||||
public String getPurchaseReturnInfo(String siteName, String user, String receiverequestname) throws Exception;
|
||||
public List<PurchaseReturnDto> getPurchaseReturnInfo(String siteName, String user, String receiverequestname) throws Exception;
|
||||
|
||||
public String purDessignOrAssign(String siteName, String user, String receiverequestname, String receiverequestdetailname, String receiveactno, String acttype, String receivequantity, String submaterialspecname) throws Exception;
|
||||
|
||||
|
@ -13,11 +13,11 @@
|
||||
LEFT JOIN MATERIALRECEIVEREQUEST R ON
|
||||
R.RECEIVEREQUESTNAME = M.RECEIVEREQUESTNAME
|
||||
WHERE
|
||||
M.SITENAME = #{SITENAME}
|
||||
M.SITENAME = #{siteName}
|
||||
AND R.RETURNFLAG = 'Y'
|
||||
AND R.RECEIVEREQUESTSTATE != 'Completed'
|
||||
AND M.ERPFACTORY = #{ERPFACTORY}
|
||||
AND M.RECEIVEREQUESTNAME LIKE #{RECEIVEREQUESTNAME}
|
||||
AND M.ERPFACTORY = #{erpFactory}
|
||||
AND M.RECEIVEREQUESTNAME LIKE #{receiverequestname}
|
||||
</select>
|
||||
<select id="getPurchaseReturnInfo" resultType="com.cim.idm.model.PurchaseReturnDto">
|
||||
SELECT
|
||||
@ -46,8 +46,8 @@
|
||||
LEFT JOIN MATERIALRECEIVEREQUEST D ON
|
||||
D.RECEIVEREQUESTNAME = A.RECEIVEREQUESTNAME
|
||||
WHERE
|
||||
A.SITENAME = #{SITENAME}
|
||||
AND A.RECEIVEREQUESTNAME = #{RECEIVEREQUESTNAME}
|
||||
A.SITENAME = #{siteName}
|
||||
AND A.RECEIVEREQUESTNAME = #{receiverequestname}
|
||||
AND D.RETURNFLAG = 'Y'
|
||||
ORDER BY
|
||||
A.RECEIVEREQUESTDETAILNAME
|
||||
@ -56,8 +56,9 @@
|
||||
<select id="getPurchaseReturnBoxList"
|
||||
resultType="com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking">
|
||||
SELECT * FROM MATERIALPACKING WHERE 1=1
|
||||
AND SHIPREQUESTNAME = #{RECEIVEREQUESTNAME}
|
||||
AND SHIPREQUESTNAME = #{receiverequestname}
|
||||
AND STOCKSTATE = 'Stocked'
|
||||
</select>
|
||||
<select id="getPurPackingInfo" resultType="com.cim.idm.model.PurchaseReturnDto"></select>
|
||||
</mapper>
|
||||
|
Loading…
x
Reference in New Issue
Block a user