Merge branch 'main' of http://162.14.99.253:3000/10539622/2025-03-JS-SDK-svr
This commit is contained in:
commit
53aa7694c9
@ -23,8 +23,12 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import com.cim.idm.service.Impl.InvoiceServiceImpl;
|
import com.cim.idm.service.Impl.InvoiceServiceImpl;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Api("单据接口")
|
@Api("单据接口")
|
||||||
@RestController
|
@RestController
|
||||||
@ -59,8 +63,12 @@ public class PurchaseReturnController {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
List<PurchaseReturnDto> purchaseReturnList =
|
List<PurchaseReturnDto> purchaseReturnList =
|
||||||
purchaseReturnServiceDao.getPurchaseReturnList(siteName, user, receiverequestname);
|
purchaseReturnService.getPurchaseReturnList(siteName, user, receiverequestname, erpfactory);
|
||||||
return AjaxResult.me().setResultObj(purchaseReturnList);
|
//将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) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.me().setErrorCode(500).setMessage("未找到对应的数据!");
|
return AjaxResult.me().setErrorCode(500).setMessage("未找到对应的数据!");
|
||||||
}
|
}
|
||||||
@ -108,7 +116,10 @@ public class PurchaseReturnController {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
List<PurchaseReturnDto> purchaseReturnInfo =
|
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);
|
return AjaxResult.me().setResultObj(purchaseReturnInfo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.me().setErrorCode(500).setMessage("未找到对应的数据!");
|
return AjaxResult.me().setErrorCode(500).setMessage("未找到对应的数据!");
|
||||||
@ -364,4 +375,18 @@ public class PurchaseReturnController {
|
|||||||
}
|
}
|
||||||
return AjaxResult.me().setResultObj(null);
|
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
|
//获取库存BoxList
|
||||||
public List<MaterialPacking> getPurchaseReturnBoxList(@Param("siteName") String siteName, @Param("receiverequestname") String receiverequestname) throws Exception;
|
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;
|
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.PurchaseReturnServiceDao;
|
||||||
import com.cim.idm.dao.ToSapDao;
|
import com.cim.idm.dao.ToSapDao;
|
||||||
|
import com.cim.idm.model.PurchaseReturnDto;
|
||||||
import com.cim.idm.service.PurchaseReturnService;
|
import com.cim.idm.service.PurchaseReturnService;
|
||||||
import com.cim.idm.service.impl.ToSAPServiceImpl;
|
import com.cim.idm.service.impl.ToSAPServiceImpl;
|
||||||
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking;
|
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -29,8 +31,9 @@ public class PurchaseReturnServiceImpl implements PurchaseReturnService {
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getPurchaseReturnList(String siteName, String user, String receiverequestname) throws Exception {
|
@Transactional
|
||||||
return "";
|
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
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getPurchaseReturnInfo(String siteName, String user, String receiverequestname) throws Exception {
|
@Transactional
|
||||||
return "";
|
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
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public String completeReceiveRequest(String siteName, String user, String receiverequestname) throws Exception {
|
public String completeReceiveRequest(String siteName, String user, String receiverequestname) throws Exception {
|
||||||
//查找需要过账的采购退库信息
|
//查找需要过账的采购退库信息
|
||||||
List<MaterialPacking> purchaseReturnBoxList = purchaseReturnServiceDao.getPurchaseReturnBoxList(siteName, receiverequestname);
|
List<MaterialPacking> purchaseReturnBoxList = purchaseReturnServiceDao.getPurchaseReturnBoxList(siteName, receiverequestname);
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
package com.cim.idm.service;
|
package com.cim.idm.service;
|
||||||
|
|
||||||
|
import com.cim.idm.model.PurchaseReturnDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface PurchaseReturnService {
|
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;
|
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
|
LEFT JOIN MATERIALRECEIVEREQUEST R ON
|
||||||
R.RECEIVEREQUESTNAME = M.RECEIVEREQUESTNAME
|
R.RECEIVEREQUESTNAME = M.RECEIVEREQUESTNAME
|
||||||
WHERE
|
WHERE
|
||||||
M.SITENAME = #{SITENAME}
|
M.SITENAME = #{siteName}
|
||||||
AND R.RETURNFLAG = 'Y'
|
AND R.RETURNFLAG = 'Y'
|
||||||
AND R.RECEIVEREQUESTSTATE != 'Completed'
|
AND R.RECEIVEREQUESTSTATE != 'Completed'
|
||||||
AND M.ERPFACTORY = #{ERPFACTORY}
|
AND M.ERPFACTORY = #{erpFactory}
|
||||||
AND M.RECEIVEREQUESTNAME LIKE #{RECEIVEREQUESTNAME}
|
AND M.RECEIVEREQUESTNAME LIKE #{receiverequestname}
|
||||||
</select>
|
</select>
|
||||||
<select id="getPurchaseReturnInfo" resultType="com.cim.idm.model.PurchaseReturnDto">
|
<select id="getPurchaseReturnInfo" resultType="com.cim.idm.model.PurchaseReturnDto">
|
||||||
SELECT
|
SELECT
|
||||||
@ -46,8 +46,8 @@
|
|||||||
LEFT JOIN MATERIALRECEIVEREQUEST D ON
|
LEFT JOIN MATERIALRECEIVEREQUEST D ON
|
||||||
D.RECEIVEREQUESTNAME = A.RECEIVEREQUESTNAME
|
D.RECEIVEREQUESTNAME = A.RECEIVEREQUESTNAME
|
||||||
WHERE
|
WHERE
|
||||||
A.SITENAME = #{SITENAME}
|
A.SITENAME = #{siteName}
|
||||||
AND A.RECEIVEREQUESTNAME = #{RECEIVEREQUESTNAME}
|
AND A.RECEIVEREQUESTNAME = #{receiverequestname}
|
||||||
AND D.RETURNFLAG = 'Y'
|
AND D.RETURNFLAG = 'Y'
|
||||||
ORDER BY
|
ORDER BY
|
||||||
A.RECEIVEREQUESTDETAILNAME
|
A.RECEIVEREQUESTDETAILNAME
|
||||||
@ -56,8 +56,9 @@
|
|||||||
<select id="getPurchaseReturnBoxList"
|
<select id="getPurchaseReturnBoxList"
|
||||||
resultType="com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking">
|
resultType="com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking">
|
||||||
SELECT * FROM MATERIALPACKING WHERE 1=1
|
SELECT * FROM MATERIALPACKING WHERE 1=1
|
||||||
AND SHIPREQUESTNAME = #{RECEIVEREQUESTNAME}
|
AND SHIPREQUESTNAME = #{receiverequestname}
|
||||||
AND STOCKSTATE = 'Stocked'
|
AND STOCKSTATE = 'Stocked'
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getPurPackingInfo" resultType="com.cim.idm.model.PurchaseReturnDto"></select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user