|
|
|
@ -9,6 +9,8 @@ import cn.chjyj.szwh.utils.SzwhApiUtils; |
|
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.logging.Log; |
|
|
|
import org.apache.commons.logging.LogFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@ -21,6 +23,7 @@ import java.util.List; |
|
|
|
@Service |
|
|
|
@Transactional |
|
|
|
public class GoodsTaskServiceImpl implements GoodsTaskService { |
|
|
|
private static Log log = LogFactory.getLog(GoodsTaskServiceImpl.class); |
|
|
|
@Autowired |
|
|
|
private GoodsMapper goodsMapper; |
|
|
|
@Autowired |
|
|
|
@ -84,6 +87,10 @@ public class GoodsTaskServiceImpl implements GoodsTaskService { |
|
|
|
Goods dbgoods =goodsMapper.getGoodsByIsliCode(islicode); |
|
|
|
String opmsg="";//操作信息
|
|
|
|
if(dbgoods!=null){ |
|
|
|
// 已经更新的,不再处理
|
|
|
|
if(dbgoods.getApplyOut()==1 && dbgoods.getGoodsStatus()==2){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
OperationLog oplog = new OperationLog(); |
|
|
|
oplog.setType("goods"); |
|
|
|
oplog.setLogid(dbgoods.getId()); |
|
|
|
@ -91,20 +98,23 @@ public class GoodsTaskServiceImpl implements GoodsTaskService { |
|
|
|
String nowstr=sdf.format(new Date())+" "; |
|
|
|
//审核通过,更新对应的状态
|
|
|
|
if(verifyStatus==1){ |
|
|
|
String gid=dbgoods.getId().toString(); |
|
|
|
// 商品状态
|
|
|
|
Integer gstatusArr[]={1,5}; |
|
|
|
List<Integer> gslist = Arrays.asList(gstatusArr); |
|
|
|
//申请撤销委托
|
|
|
|
if(dbgoods.getApplyOut()==1){ |
|
|
|
int ret =goodsMapper.updateGoodsField("goods_status","2",islicode); |
|
|
|
if(dbgoods.getApplyOut()==1 && dbgoods.getGoodsStatus()!=2){ |
|
|
|
int ret =goodsMapper.updateGoodsField("goods_status","2",gid); |
|
|
|
log.info("申请撤销委托:"+islicode); |
|
|
|
//todo order操作订单
|
|
|
|
opmsg = nowstr+"申请撤销委托审核通过"; |
|
|
|
oplog.setMessage(opmsg); |
|
|
|
operationLogMapper.addLog(oplog); |
|
|
|
}else{ |
|
|
|
if(gslist.contains(dbgoods.getGoodsStatus())){ |
|
|
|
goodsMapper.updateGoodsField("goods_status","2",islicode); |
|
|
|
goodsMapper.updateGoodsField("apply_out","1",islicode); |
|
|
|
if(gslist.contains(dbgoods.getGoodsStatus()) && dbgoods.getGoodsStatus()!=2){ |
|
|
|
log.info("委托系统:"+islicode); |
|
|
|
goodsMapper.updateGoodsField("goods_status","2",gid); |
|
|
|
goodsMapper.updateGoodsField("apply_out","1",gid); |
|
|
|
opmsg = nowstr+"委托系统撤销委托"; |
|
|
|
oplog.setMessage(opmsg); |
|
|
|
operationLogMapper.addLog(oplog); |
|
|
|
@ -115,6 +125,7 @@ public class GoodsTaskServiceImpl implements GoodsTaskService { |
|
|
|
if(dbgoods.getApplyOut()==1){ |
|
|
|
goodsMapper.updateGoodsField("apply_out","0",islicode); |
|
|
|
} |
|
|
|
log.info("申请撤销委托审核不通过:"+islicode); |
|
|
|
opmsg = nowstr+"申请撤销委托审核不通过"; |
|
|
|
oplog.setMessage(opmsg); |
|
|
|
operationLogMapper.addLog(oplog); |
|
|
|
|