|
@@ -19,6 +19,8 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import com.pj.api.bo.OtherBusinessBO;
|
|
|
|
|
+import com.pj.api.bo.OtherBusinessEditBO;
|
|
|
import com.pj.api.open.ResultJson;
|
|
import com.pj.api.open.ResultJson;
|
|
|
import com.pj.api.wx.bo.MsgDataBO;
|
|
import com.pj.api.wx.bo.MsgDataBO;
|
|
|
import com.pj.api.wx.service.WxService;
|
|
import com.pj.api.wx.service.WxService;
|
|
@@ -218,9 +220,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
}
|
|
}
|
|
|
TbCar tbCar = tbCarService.findByCardNo(carNo);
|
|
TbCar tbCar = tbCarService.findByCardNo(carNo);
|
|
|
tbBusinessCar.setBusinessId(t.getId());
|
|
tbBusinessCar.setBusinessId(t.getId());
|
|
|
- tbBusinessCar.setCarNo(carNo).setCarCompany(tbCar!=null?tbCar.getCustomerName():"临时");
|
|
|
|
|
|
|
+ tbBusinessCar.setCarNo(carNo).setCarCompany(tbCar != null ? tbCar.getCustomerName() : "临时");
|
|
|
tbBusinessCar.setBusinessId(t.getId()).setCustomerId(t.getCustomerId());
|
|
tbBusinessCar.setBusinessId(t.getId()).setCustomerId(t.getCustomerId());
|
|
|
- if(StrUtil.isEmpty(tbBusinessCar.getNo())){
|
|
|
|
|
|
|
+ if (StrUtil.isEmpty(tbBusinessCar.getNo())) {
|
|
|
tbBusinessCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
|
|
tbBusinessCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -234,7 +236,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo).setCustomerId(t.getCustomerId());
|
|
yueCar.setBusinessId(t.getId()).setCarSize(t.getCardSize()).setCarNo(yueCarNo).setCustomerId(t.getCustomerId());
|
|
|
- if(StrUtil.isEmpty(yueCar.getNo())){
|
|
|
|
|
|
|
+ if (StrUtil.isEmpty(yueCar.getNo())) {
|
|
|
yueCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
|
|
yueCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
|
|
|
}
|
|
}
|
|
|
carList.add(yueCar);
|
|
carList.add(yueCar);
|
|
@@ -498,8 +500,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
BigDecimal partMoney = new BigDecimal("0");
|
|
BigDecimal partMoney = new BigDecimal("0");
|
|
|
String carNo = tbBusinessCar.getCarNo().substring(0, 1);
|
|
String carNo = tbBusinessCar.getCarNo().substring(0, 1);
|
|
|
if (inTime != null && CAR_LIST.contains(carNo)) {
|
|
if (inTime != null && CAR_LIST.contains(carNo)) {
|
|
|
- if (tbBusinessCar.getPay()==1&&tbBusinessCar.getPayTime()!=null){
|
|
|
|
|
- inTime=tbBusinessCar.getPayTime();
|
|
|
|
|
|
|
+ if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getPayTime() != null) {
|
|
|
|
|
+ inTime = tbBusinessCar.getPayTime();
|
|
|
}
|
|
}
|
|
|
partMoney = this.calculationPartMoney(inTime, now);
|
|
partMoney = this.calculationPartMoney(inTime, now);
|
|
|
}
|
|
}
|
|
@@ -510,7 +512,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
List<String> colorList = freeList.stream().map(f -> f.getCarNoColor().substring(0, 1)).collect(Collectors.toList());
|
|
List<String> colorList = freeList.stream().map(f -> f.getCarNoColor().substring(0, 1)).collect(Collectors.toList());
|
|
|
String color = tbBusinessCar.getColor().substring(0, 1);
|
|
String color = tbBusinessCar.getColor().substring(0, 1);
|
|
|
if (colorList.contains(color)) {
|
|
if (colorList.contains(color)) {
|
|
|
- partMoney=new BigDecimal("0");
|
|
|
|
|
|
|
+ partMoney = new BigDecimal("0");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Map<String, Object> carMap = new HashMap<>();
|
|
Map<String, Object> carMap = new HashMap<>();
|
|
@@ -524,9 +526,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
}
|
|
}
|
|
|
carsList.add(carMap);
|
|
carsList.add(carMap);
|
|
|
}
|
|
}
|
|
|
- if (StrUtil.isNotEmpty(businessId)){
|
|
|
|
|
- TbBusiness tbBusiness=this.getById(businessId);
|
|
|
|
|
- if (tbBusiness!=null){
|
|
|
|
|
|
|
+ if (StrUtil.isNotEmpty(businessId)) {
|
|
|
|
|
+ TbBusiness tbBusiness = this.getById(businessId);
|
|
|
|
|
+ if (tbBusiness != null) {
|
|
|
result.put("type", tbBusiness.getBusinessType());
|
|
result.put("type", tbBusiness.getBusinessType());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -541,7 +543,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
for (TbBusinessItem item : items) {
|
|
for (TbBusinessItem item : items) {
|
|
|
Map<String, Object> itemMap = new HashMap<>();
|
|
Map<String, Object> itemMap = new HashMap<>();
|
|
|
itemMap.put("id", item.getId());
|
|
itemMap.put("id", item.getId());
|
|
|
- itemMap.put("name", item.getItemName()+"("+item.getItemTypeName()+")");
|
|
|
|
|
|
|
+ itemMap.put("name", item.getItemName() + "(" + item.getItemTypeName() + ")");
|
|
|
itemMap.put("price", item.getItemPrice().multiply(new BigDecimal(item.getNum())));
|
|
itemMap.put("price", item.getItemPrice().multiply(new BigDecimal(item.getNum())));
|
|
|
itemMap.put("pay", item.getPayStatus());
|
|
itemMap.put("pay", item.getPayStatus());
|
|
|
itemList.add(itemMap);
|
|
itemList.add(itemMap);
|
|
@@ -567,4 +569,18 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
public List<CarDisincle> getCarDisincleList(SoMap soMap) {
|
|
public List<CarDisincle> getCarDisincleList(SoMap soMap) {
|
|
|
return tbBusinessMapper.getCarDisincleList(soMap);
|
|
return tbBusinessMapper.getCarDisincleList(soMap);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public OtherBusinessEditBO getOtherBusinessById(String id) {
|
|
|
|
|
+ TbBusiness tbBusiness = this.getById(id);
|
|
|
|
|
+ List<TbBusinessItem> tbBusinessItems = tbBusinessItemService.findByBusinessId(id);
|
|
|
|
|
+ List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(id);
|
|
|
|
|
+ OtherBusinessEditBO otherBusinessBO = new OtherBusinessEditBO();
|
|
|
|
|
+ otherBusinessBO.setId(tbBusiness.getId());
|
|
|
|
|
+ otherBusinessBO.setCarNo(cars.get(0)
|
|
|
|
|
+ .getCarNo()).setCarWeight(tbBusiness.getNetWeight())
|
|
|
|
|
+ .setCarSize(tbBusiness.getCardSize()).setCarType(tbBusiness.getGoodsName())
|
|
|
|
|
+ .setItemTypeId(tbBusiness.getItemTypeId());
|
|
|
|
|
+ otherBusinessBO.setItems(tbBusinessItems);
|
|
|
|
|
+ return otherBusinessBO;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|