ruanqi 1 year ago
parent
commit
59cad11cb3
  1. 32
      src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java
  2. 9
      src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java
  3. 10
      src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java
  4. 45
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java
  5. 46
      src/main/resources/mapper/ecss/CoDelMapper.xml

32
src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java

@ -6,6 +6,7 @@ import com.xujie.sys.modules.ecss.data.EcssCoDelNotifyData;
import com.xujie.sys.modules.ecss.data.EcssCoDelNotifyDetailData;
import com.xujie.sys.modules.ecss.data.EcssCoDelNotifyHeaderData;
import com.xujie.sys.modules.ecss.entity.EcssCoDelNotify;
import com.xujie.sys.modules.ecss.entity.EcssCoDelNotifyDetail;
import com.xujie.sys.modules.ecss.service.CoDelService;
import com.xujie.sys.modules.orderIssure.entity.SOIssueNotifyHeaderData;
import com.xujie.sys.modules.part.vo.BomComponentVo;
@ -41,4 +42,35 @@ public class CoDelController {
coDelService.saveEcssCoDelNotifyByExcel(file, data);
return R.ok();
}
@PostMapping("/updateEcssDelHeader")
public R updateEcssDelHeader(@RequestBody EcssCoDelNotifyHeaderData data) {
coDelService.updateEcssDelHeader(data);
return R.ok();
}
@PostMapping("/deleteEcssDelHeader")
public R deleteEcssDelHeader(@RequestBody EcssCoDelNotifyHeaderData data) {
coDelService.deleteEcssDelHeader(data);
return R.ok();
}
@PostMapping("/changeEcssDelStatus")
public R changeEcssDelStatus(@RequestBody EcssCoDelNotifyHeaderData data) {
coDelService.changeEcssDelStatus(data);
return R.ok();
}
@PostMapping("/updateEcssDelDetail")
public R updateEcssDelDetail(@RequestBody EcssCoDelNotifyDetailData data) {
coDelService.updateEcssDelDetail(data);
return R.ok();
}
@PostMapping("/deleteEcssDelDetail")
public R deleteEcssDelDetail(@RequestBody EcssCoDelNotifyDetailData data) {
coDelService.deleteEcssDelDetail(data);
return R.ok();
}
}

9
src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java

@ -18,7 +18,7 @@ import java.util.List;
public interface CoDelMapper {
IPage<EcssCoDelNotifyHeaderData> searchEcssCoDelNotifyHeader(Page<EcssCoDelNotifyHeaderData> ecssCoDelNotifyDataPage, @Param("query") EcssCoDelNotifyHeaderData data);
List<EcssCoDelNotifyHeaderData> checkEcssCoDelNotifyHeaderByDelNo( @Param("site") String site,@Param("delNo") String delNo);
List<EcssCoDelNotifyDetailData> searchEcssCoDelNotifyDetail(EcssCoDelNotifyHeaderData data);
String getSiteByBu(String buNo);
@ -30,4 +30,11 @@ public interface CoDelMapper {
void saveEcssCoDelNotifyHeader(EcssCoDelNotifyHeader inData);
void batchSaveEcssCoDelNotifyDetail(List<EcssCoDelNotifyData> list );
List<PartData> checkPart(@Param("site") String site, @Param("partNo") String partNo);
void updateEcssDelHeader(EcssCoDelNotifyHeaderData data);
void changeEcssDelStatus(EcssCoDelNotifyHeaderData data);
void updateEcssDelDetail(EcssCoDelNotifyDetail data);
void deleteEcssDelDetail(EcssCoDelNotifyDetail data);
}

10
src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java

@ -16,4 +16,14 @@ public interface CoDelService {
PageUtils searchEcssCoDelNotifyHeader(EcssCoDelNotifyHeaderData data);
List<EcssCoDelNotifyDetailData> searchEcssCoDelNotifyDetail(EcssCoDelNotifyHeaderData data);
void saveEcssCoDelNotifyByExcel(MultipartFile file, EcssCoDelNotifyHeaderData data);
void updateEcssDelHeader(EcssCoDelNotifyHeaderData data);
void deleteEcssDelHeader(EcssCoDelNotifyHeaderData data);
void changeEcssDelStatus(EcssCoDelNotifyHeaderData data);
void updateEcssDelDetail(EcssCoDelNotifyDetailData data);
void deleteEcssDelDetail(EcssCoDelNotifyDetailData data);
}

45
src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java

@ -1,5 +1,6 @@
package com.xujie.sys.modules.ecss.service.impl;
import com.aspose.words.Run;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -189,6 +190,20 @@ public class CoDelServiceImpl implements CoDelService {
}
@Override
public void updateEcssDelHeader(EcssCoDelNotifyHeaderData data){
coDelMapper.updateEcssDelHeader(data);
}
@Override
public void deleteEcssDelHeader(EcssCoDelNotifyHeaderData data){
List<EcssCoDelNotifyDetailData> checkEcssCoDelNotifyDetail=coDelMapper.searchEcssCoDelNotifyDetail(data);
if(checkEcssCoDelNotifyDetail.size()>0){
throw new RuntimeException("该发货通知单下有明细无法删除!");
}
}
private String getStringCellValue(XSSFRow row, int columnIndex) {
Cell cell = row.getCell(columnIndex);
if (cell == null || cell.getCellType() == CellType.BLANK) {
@ -239,4 +254,34 @@ public class CoDelServiceImpl implements CoDelService {
}
}
@Override
public void changeEcssDelStatus(EcssCoDelNotifyHeaderData data){
coDelMapper.changeEcssDelStatus(data);
}
@Override
public void updateEcssDelDetail(EcssCoDelNotifyDetailData data){
List<EcssCoDelNotifyHeaderData> checkHeader=coDelMapper.checkEcssCoDelNotifyHeaderByDelNo(data.getSite(),data.getDelNo());
if(checkHeader.size()==0){
throw new RuntimeException("不存在该发货通知单请刷新界面" );
}
if(!"已计划".equals(checkHeader.get(0).getNotifyStatus())){
throw new RuntimeException("发货通知单状态不为已计划,无法修改。" );
}
coDelMapper.updateEcssDelDetail(data);
}
@Override
public void deleteEcssDelDetail(EcssCoDelNotifyDetailData data){
List<EcssCoDelNotifyHeaderData> checkHeader=coDelMapper.checkEcssCoDelNotifyHeaderByDelNo(data.getSite(),data.getDelNo());
if(checkHeader.size()==0){
throw new RuntimeException("不存在该发货通知单请刷新界面" );
}
if(!"已计划".equals(checkHeader.get(0).getNotifyStatus())){
throw new RuntimeException("发货通知单状态不为已计划,无法删除。" );
}
coDelMapper.deleteEcssDelDetail(data);
}
}

46
src/main/resources/mapper/ecss/CoDelMapper.xml

@ -26,16 +26,27 @@
<where>
<if test="query.username != null and query.username != ''">
AND a.NotifyNo = #{query.username}
</if>
and D.site is not null
</where>
order by a.ready_date desc ,a.delNo desc
</select>
<select id="checkEcssCoDelNotifyHeaderByDelNo" resultType="EcssCoDelNotifyHeaderData">
select a.site,a.bu_no,a.delNo,a.erp_delNo,a.ready_date,a.notifyDate,a.customer_name,a.Destination,a.shipping_mode,a.erp_flag,
a.notify_status,a.remark,a.createDate,a.createBy,a.cmc_invoice,a.updateDate,a.updateBy,dbo.get_bu_desc(a.site,a.bu_no) as buDesc
from ecss_CoDelNotifyHeader a
<if test="site != null and site != ''">
AND a.site = #{site}
</if>
<if test="delNo != null and delNo != ''">
AND a.delNo = #{delNo}
</if>
</select>
<select id="searchEcssCoDelNotifyDetail" resultType="EcssCoDelNotifyDetailData">
select a.site,a.bu_no,a.delNo,a.item_no,a.salesOrder,a.salesOrder_item_no,a.customerPO,a.line,a.version,a.status,a.family,
a.part_no,a.part_description,a.qty,a.lt,a.cmc_invoice,a.cmc_comment,a.saleType,a.awb_bl,a.shipping_number,a.forwarder_info,
a.part_no,a.part_description,a.qty,a.lt,a.cmc_comment,a.saleType,a.awb_bl,a.shipping_number,a.forwarder_info,
a.currency,a.tp,a.ttl_amount,a.sum_price,a.so,a.upc,a.remark,a.erp_delItemNo
from ecss_CoDelNotifydetail a
@ -73,19 +84,19 @@
</select>
<insert id="saveEcssCoDelNotifyHeader" >
insert into ecss_CoDelNotifyHeader(site,bu_no,delNo,ready_date,customer_name,Destination,shipping_mode,erp_flag,notify_status,
remark,createDate,createBy,cmc_invoice)
remark,createDate,createBy,cmc_invoice)
values(#{site},#{buNo},#{delNo},#{readyDate},#{customerName},#{destination},#{shippingMode},'N',#{notifyStatus},#{remark},GetDate(),
#{createBy},#{cmcInvoice})
</insert>
<insert id="batchSaveEcssCoDelNotifyDetail">
insert into ecss_CoDelNotifyDetail (site,bu_no,delNo,item_no,salesOrder,salesOrder_item_no,customerPO,line,version,
status,family,part_no,part_description,qty,lt,cmc_invoice,cmc_comment,saleType,
status,family,part_no,part_description,qty,lt,cmc_comment,saleType,
awb_bl,shipping_number,forwarder_info,currency,tp,ttl_amount,sum_price,
so,upc,remark)
values
<foreach collection="list" separator="," item="item">
(#{item.site},#{item.buNo},#{item.delNo},#{item.itemNo,jdbcType=INTEGER},#{item.salesOrder},#{item.salesOrderItemNo},#{item.customerPO},#{item.line},#{item.version},
#{item.status},#{item.family},#{item.partNo},#{item.partDescription},#{item.qty,jdbcType=DECIMAL},#{item.lt,jdbcType=DECIMAL},#{item.cmcInvoice},#{item.cmcComment},#{item.saleType},
#{item.status},#{item.family},#{item.partNo},#{item.partDescription},#{item.qty,jdbcType=DECIMAL},#{item.lt,jdbcType=DECIMAL},#{item.cmcComment},#{item.saleType},
#{item.awbBl},#{item.shippingNumber},#{item.forwarderInfo},#{item.currency},#{item.tp,jdbcType=DECIMAL},#{item.ttlAmount,jdbcType=DECIMAL},#{item.sumPrice,jdbcType=DECIMAL},
#{item.so},#{item.upc},#{item.remark})
</foreach>
@ -94,4 +105,25 @@ remark,createDate,createBy,cmc_invoice)
<select id="checkPart" resultType="PartData">
select site,part_no from Part where site=#{site,jdbcType=VARCHAR} and part_no=#{partNo}
</select>
<update id="updateEcssDelHeader" >
update ecss_CoDelNotifyHeader set ready_date=#{readyDate,jdbcType=TIMESTAMP} ,customer_name=#{customerName},Destination=#{destination},shipping_mode=#{shippingMode},remark=#{remark} ,cmc_invoice=#{cmcInvoice}
where site=#{site} and delNo=#{delNo}
</update>
<update id="changeEcssDelStatus">
update ecss_CoDelNotifyHeader set notify_status=#{notifyStatus} where site=#{site} and delNo=#{delNo}
</update>
<update id="updateEcssDelDetail">
update ecss_CoDelNotifyDetail set salesOrder=#{saleType},customerPO=#{customerPO},line=#{line},version=#{version},
status=#{status},family=#{family},part_no=#{partNo},part_description=#{partDescription},qty=#{qty,jdbcType=DECIMAL},lt=#{lt,jdbcType=DECIMAL},cmc_comment=#{cmcComment},saleType=#{saleType},
awb_bl=#{awbBl},shipping_number=#{shippingNumber},forwarder_info=#{forwarderInfo},currency=#{currency},tp=#{tp,jdbcType=DECIMAL},ttl_amount=#{ttlAmount,jdbcType=DECIMAL},sum_price=#{sumPrice,jdbcType=DECIMAL},
so=#{so},upc=#{upc},remark=#{remark}
where site=#{site} and delNo=#{delNo} and item_no=#{itemNo}
</update>
<delete id="deleteEcssDelDetail">
delete from ecss_CoDelNotifyDetail where site=#{site} and delNo=#{delNo} and item_no=#{itemNo}
</delete>
</mapper>
Loading…
Cancel
Save