package com.changhong.epc.tenant.service.bill.impl;
|
|
import com.changhong.epc.bean.tenant.bill.BillData;
|
import com.changhong.epc.tenant.mapper.tenant.bill.BillDataMapper;
|
import com.changhong.epc.tenant.service.bill.BillDataService;
|
import com.iemsoft.framework.cloud.core.tools.ObjectUtil;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
import java.util.Map;
|
@Service("billDataService")
|
public class BillDataServiceImpl implements BillDataService {
|
|
/**
|
* 票据信息
|
*/
|
@Resource
|
private BillDataMapper billDataMapper;
|
|
@Override
|
public List<BillData> selectByCode(BillData orderCode) {
|
return orderCode.getOrderCode() == null ? null : billDataMapper.select(orderCode);
|
}
|
|
@Override
|
public BillData selectByOrderCodeAndJ(String orderCode, Integer jId) {
|
BillData asdas = billDataMapper.selectByOrderCodeAndJ(orderCode, jId);
|
return asdas;
|
}
|
|
@Override
|
public Integer updateBillDataByJouryId(Map<String, Object> paramMap) {
|
String orderCode = paramMap.get("orderCode").toString();
|
@SuppressWarnings("unchecked")
|
List<Integer> dataRowNums = (List<Integer>) paramMap.get("dataRowNums");
|
List<BillData> billData = billDataMapper.selectByOrderCode(orderCode);
|
billDataMapper.deleteByOrderCode(orderCode);
|
int i = 0;
|
if(ObjectUtil.empty(dataRowNums)){
|
return i;
|
}
|
for(Integer dataRowNum :dataRowNums){
|
i ++;
|
billData.stream().sorted().forEach(o -> {
|
o.setJId(dataRowNum);
|
o.initParam();
|
billDataMapper.insert(o);
|
});
|
}
|
return i;
|
}
|
|
}
|