Browse Source

修改update

master
clong 1 year ago
parent
commit
59330683dd
3 changed files with 28 additions and 3 deletions
  1. +16
    -0
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml
  2. +9
    -0
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java
  3. +3
    -3
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java

+ 16
- 0
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/SalesOrderDetailMapper.xml View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.digiwin.athena.app.infra.repository.SalesOrderDetailRepository">
<update id="updateStatus">
<foreach collection="list" item="item" close="" open="" separator=";">
update cim_sales_order_detail set status = 2
where id = #{item.id} and tenantsid = #{item.tenantSid}
</foreach>
</update>
</mapper>

+ 9
- 0
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/SalesOrderDetailRepository.java View File

@ -3,6 +3,15 @@ package com.digiwin.athena.app.infra.repository;
import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity;
import com.digiwin.athena.opt.persistence.repository.BaseRepository;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SalesOrderDetailRepository extends BaseRepository<SalesOrderDetailEntity> {
/**
* 更新数据
* @param list
*/
void updateStatus(@Param("list") List<SalesOrderDetailEntity> list);
}

+ 3
- 3
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/order/SalesOrderDetailUpdateEAIService.java View File

@ -4,6 +4,7 @@ package com.digiwin.athena.app.service.order;
import com.alibaba.fastjson.TypeReference;
import com.digiwin.app.service.DWEAIResult;
import com.digiwin.athena.app.infra.entity.SalesOrderDetailEntity;
import com.digiwin.athena.app.infra.repository.SalesOrderDetailRepository;
import com.digiwin.athena.app.infra.service.SalesOrderDetailService;
import com.digiwin.athena.opt.common.eai.EAIRequest;
import com.digiwin.athena.opt.common.eai.EAIUtil;
@ -27,7 +28,7 @@ import java.util.stream.Collectors;
public class SalesOrderDetailUpdateEAIService extends AbsEAIService {
@Resource
SalesOrderDetailService salesOrderDetailService;
SalesOrderDetailRepository salesOrderDetailRepository;
@Override
public String getServiceName() {
@ -45,11 +46,10 @@ public class SalesOrderDetailUpdateEAIService extends AbsEAIService {
SalesOrderDetailEntity salesOrderDetailEntity = new SalesOrderDetailEntity();
salesOrderDetailEntity.setId(assemble.getId());
salesOrderDetailEntity.setTenantSid(1L);
salesOrderDetailEntity.setStatus(2);
return salesOrderDetailEntity;
}).collect(Collectors.toList());
salesOrderDetailService.updateBatchById(salesOrderDetailEntityList);
salesOrderDetailRepository.updateStatus(salesOrderDetailEntityList);
return EAIUtil.buildEAIResult(new HashMap<>());
}


Loading…
Cancel
Save