Browse Source

fix bug

release_toaliyun_real
zhengfangyuan 3 years ago
parent
commit
050bd6149a
4 changed files with 29 additions and 3 deletions
  1. +11
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxPressBatchController.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxPressBatchService.java
  3. +15
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxPressBatchServiceImpl.java
  4. +1
    -1
      mallinkService/src/main/resources/mapper/WxPressBatchItemMapper.xml

+ 11
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxPressBatchController.java View File

@@ -134,6 +134,17 @@ public class WxPressBatchController extends BaseController {
wxPressBatchService.deleteItemById(record.getId(), getTenantInfo().getTenantId());
return new ResultData();
}
@ApiOperation("详情接口")
@PostMapping("updateStatus")
public ResultData updateStatus(@RequestBody WxPressBatch record) {
if (null == record.getId() || null == record.getStatus()) {
return new ResultData(Result.ERROR,"参数错误");
}
record.updateTenantInfo(getTenantInfo());
wxPressBatchService.updateStatus(record);
return new ResultData();
}




+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxPressBatchService.java View File

@@ -47,6 +47,8 @@ public interface WxPressBatchService {
void deleteItemById(Long itemId,String tenantId);
void deleteItemByBatchId(Long batchId,String tenantId);
void updateStatus(WxPressBatch pressBatch);
//验证砍价人规则
ResultData checkBargainerPressBatchRule(WxOrder order, Long cUserId);


+ 15
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxPressBatchServiceImpl.java View File

@@ -4,6 +4,7 @@ import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.IdWorker;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
@@ -69,6 +70,8 @@ public class WxPressBatchServiceImpl implements WxPressBatchService {
@Override
public void saveOrUpdate(WxPressBatch record) {
if (null == record.getId()) {
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
record.setCreateDate(new Date());
record.setUpdateDate(new Date());
wxPressBatchMapper.insert(record);
@@ -106,8 +109,8 @@ public class WxPressBatchServiceImpl implements WxPressBatchService {
}
}

@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
@Override
public void deleteBatch(Long id, String tenantId) {
wxPressBatchMapper.deleteById(id, tenantId);
deleteItemByBatchId(id, tenantId);
@@ -128,6 +131,17 @@ public class WxPressBatchServiceImpl implements WxPressBatchService {
iteq.setPressBatchId(batchId);
wxPressBatchItemMapper.deleteAllItem(iteq);
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
@Override
public void updateStatus(WxPressBatch pressBatch) {
wxPressBatchMapper.updateWxPressBatchStatus(pressBatch);
WxPressBatchItem item = new WxPressBatchItem();
item.updateTenantInfo(pressBatch);
item.setPressBatchId(pressBatch.getId());
item.setPressBatchStatus(pressBatch.getStatus());
wxPressBatchItemMapper.updateWxPressBatchStatus(item);
}

@Override
public ResultData checkBargainerPressBatchRule(WxOrder order, Long cUserId) {
@@ -202,5 +216,4 @@ public class WxPressBatchServiceImpl implements WxPressBatchService {
}
return null;
}

}

+ 1
- 1
mallinkService/src/main/resources/mapper/WxPressBatchItemMapper.xml View File

@@ -79,7 +79,7 @@
</select>
<update id="updateWxPressBatchStatus" parameterType="com.iformall.domain.po.WxPressBatchItem" >
update wx_press_batch_item set press_batch_status = #{status} where `press_batch_id` = #{pressBatchId} and tenant_id=#{tenantId}
update wx_press_batch_item set press_batch_status = #{pressBatchStatus} where `press_batch_id` = #{pressBatchId} and tenant_id=#{tenantId}
</update>
<delete id= "deleteItem" parameterType="com.iformall.domain.po.WxPressBatchItem" >


Loading…
Cancel
Save