修改交班
This commit is contained in:
@@ -45,8 +45,9 @@ public class HandoverInfo implements Serializable {
|
|||||||
|
|
||||||
private List<ProductInfo> productInfos;
|
private List<ProductInfo> productInfos;
|
||||||
|
|
||||||
public HandoverInfo(String merchantName, String startTime, String endTime, String staff, List<PayInfo> payInfos, List<HandoverInfo.MemberData> memberData, String totalAmount, String imprest, String payable, String handIn, String returnAmount,String orderNum
|
|
||||||
,List<ProductCategory> productCategories,String quickAmount,List<ProductInfoPO> productInfoPOS,List<ProductInfo> productInfos
|
public HandoverInfo(String merchantName, String startTime, String endTime, String staff, List<PayInfo> payInfos, List<HandoverInfo.MemberData> memberData, String totalAmount, String imprest, String payable, String handIn, String returnAmount, String orderNum
|
||||||
|
, List<ProductCategory> productCategories, String quickAmount, List<ProductInfoPO> productInfoPOS, List<ProductInfo> productInfos
|
||||||
|
|
||||||
) {
|
) {
|
||||||
this.merchantName = merchantName;
|
this.merchantName = merchantName;
|
||||||
|
|||||||
@@ -70,62 +70,75 @@ public class DataService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByPrimaryKey(id);
|
|
||||||
// ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByShopIdAndDay(tbShopInfo.getId(),tradeDay);
|
|
||||||
MsgException.checkNull(shopUserDuty,"交班信息不存在");
|
|
||||||
|
|
||||||
|
|
||||||
TbPlussShopStaff shopStaff= tbPlussShopStaffMapper.selectByPrimaryKey(Integer.valueOf(info.get("staffId").toString()));
|
TbPlussShopStaff shopStaff= tbPlussShopStaffMapper.selectByPrimaryKey(Integer.valueOf(info.get("staffId").toString()));
|
||||||
MsgException.checkNull(shopStaff,"员工信息不存在");
|
MsgException.checkNull(shopStaff,"员工信息不存在");
|
||||||
|
|
||||||
|
ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByPrimaryKey(id);
|
||||||
|
|
||||||
List<HandoverInfo.PayInfo> list=null;
|
if(ObjectUtil.isNotNull(shopUserDuty)&&ObjectUtil.isNotEmpty(shopUserDuty)){
|
||||||
List<HandoverInfo.MemberData> memberData=null;
|
List<HandoverInfo.PayInfo> list=null;
|
||||||
List<HandoverInfo.ProductCategory> productCategories=null;
|
List<HandoverInfo.MemberData> memberData=null;
|
||||||
List<Map<String,Object>> mapList= shopUserDutyPayMapper.selectByDutyId(shopUserDuty.getId());
|
List<HandoverInfo.ProductCategory> productCategories=null;
|
||||||
if(ObjectUtil.isNotEmpty(mapList)&&mapList.size()>0){
|
List<Map<String,Object>> mapList= shopUserDutyPayMapper.selectByDutyId(shopUserDuty.getId());
|
||||||
list= JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(mapList), HandoverInfo.PayInfo.class);
|
if(ObjectUtil.isNotEmpty(mapList)&&mapList.size()>0){
|
||||||
|
list= JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(mapList), HandoverInfo.PayInfo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
memberData=new ArrayList<>();
|
||||||
|
ShopUserDutyPay shopUserDutyPay=shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(),"deposit");
|
||||||
|
if(ObjectUtil.isNotEmpty(shopUserDutyPay)){
|
||||||
|
memberData.add(new HandoverInfo.MemberData(shopUserDutyPay.getAmount().toPlainString(),"会员卡消费"));
|
||||||
|
}
|
||||||
|
|
||||||
|
memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberInAmount())? BigDecimal.ZERO.toPlainString() : shopUserDuty.getMemberInAmount().toPlainString(),"会员卡充值"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<Map<String,Object>> categries= shopUserDutyPayMapper.selectCetoryBydutyId(shopUserDuty.getId());
|
||||||
|
if(ObjectUtil.isNotEmpty(categries)&&categries.size()>0){
|
||||||
|
productCategories=JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(categries),HandoverInfo.ProductCategory.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<ProductInfoPO> productInfoPOS = shopUserDutyPayMapper.selectProductByDutyId(shopUserDuty.getId());
|
||||||
|
List<ProductInfo> productInfos = shopUserDutyMapper.selectByDutyId(shopUserDuty.getId());
|
||||||
|
|
||||||
|
|
||||||
|
HandoverInfo handoverInfo=new HandoverInfo(tbShopInfo.getShopName(),
|
||||||
|
ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime())? DateUtils.getTime(shopUserDuty.getLoginTime()):null,
|
||||||
|
DateUtils.getTime(new Date()),
|
||||||
|
ObjectUtil.isNull(shopStaff.getName())?"":shopStaff.getName(),
|
||||||
|
list,memberData,shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount())?BigDecimal.ZERO:shopUserDuty.getQuickAmount()).toPlainString(),
|
||||||
|
"0",
|
||||||
|
shopUserDuty.getAmount().subtract(shopUserDuty.getReturnAmount()).toPlainString(),
|
||||||
|
shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount())?BigDecimal.ZERO:shopUserDuty.getQuickAmount()).toPlainString(),
|
||||||
|
shopUserDuty.getReturnAmount().toPlainString(),
|
||||||
|
shopUserDuty.getOrderNum().toString(),
|
||||||
|
productCategories,ObjectUtil.isNull(shopUserDuty.getQuickAmount())?"0":shopUserDuty.getQuickAmount().toPlainString(),
|
||||||
|
productInfoPOS,productInfos
|
||||||
|
|
||||||
|
);
|
||||||
|
return Result.success(CodeEnum.SUCCESS,handoverInfo);
|
||||||
|
}else{
|
||||||
|
HandoverInfo handoverInfo=new HandoverInfo(tbShopInfo.getShopName(),
|
||||||
|
ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime())? DateUtils.getTime(shopUserDuty.getLoginTime()):null,
|
||||||
|
DateUtils.getTime(new Date()),
|
||||||
|
ObjectUtil.isNull(shopStaff.getName())?"":shopStaff.getName(),
|
||||||
|
null,null,"0",
|
||||||
|
"0",
|
||||||
|
"0",
|
||||||
|
"0",
|
||||||
|
"0",
|
||||||
|
"0",
|
||||||
|
null,"0",
|
||||||
|
null,null
|
||||||
|
|
||||||
|
);
|
||||||
|
return Result.success(CodeEnum.SUCCESS,handoverInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
memberData=new ArrayList<>();
|
|
||||||
ShopUserDutyPay shopUserDutyPay=shopUserDutyPayMapper.selectByDuctIdAndType(shopUserDuty.getId(),"deposit");
|
|
||||||
if(ObjectUtil.isNotEmpty(shopUserDutyPay)){
|
|
||||||
memberData.add(new HandoverInfo.MemberData(shopUserDutyPay.getAmount().toPlainString(),"会员卡消费"));
|
|
||||||
}
|
|
||||||
|
|
||||||
memberData.add(new HandoverInfo.MemberData(ObjectUtil.isNull(shopUserDuty.getMemberInAmount())? BigDecimal.ZERO.toPlainString() : shopUserDuty.getMemberInAmount().toPlainString(),"会员卡充值"));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<Map<String,Object>> categries= shopUserDutyPayMapper.selectCetoryBydutyId(shopUserDuty.getId());
|
|
||||||
if(ObjectUtil.isNotEmpty(categries)&&categries.size()>0){
|
|
||||||
productCategories=JSONUtil.parseJSONStr2TList(JSONUtil.toJSONString(categries),HandoverInfo.ProductCategory.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<ProductInfoPO> productInfoPOS = shopUserDutyPayMapper.selectProductByDutyId(shopUserDuty.getId());
|
|
||||||
List<ProductInfo> productInfos = shopUserDutyMapper.selectByDutyId(shopUserDuty.getId());
|
|
||||||
|
|
||||||
|
|
||||||
HandoverInfo handoverInfo=new HandoverInfo(tbShopInfo.getShopName(),
|
|
||||||
ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime())? DateUtils.getTime(shopUserDuty.getLoginTime()):null,
|
|
||||||
DateUtils.getTime(new Date()),
|
|
||||||
ObjectUtil.isNull(shopStaff.getName())?"":shopStaff.getName(),
|
|
||||||
list,memberData,shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount())?BigDecimal.ZERO:shopUserDuty.getQuickAmount()).toPlainString(),
|
|
||||||
"0",
|
|
||||||
shopUserDuty.getAmount().subtract(shopUserDuty.getReturnAmount()).toPlainString(),
|
|
||||||
shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount())?BigDecimal.ZERO:shopUserDuty.getQuickAmount()).toPlainString(),
|
|
||||||
shopUserDuty.getReturnAmount().toPlainString(),
|
|
||||||
shopUserDuty.getOrderNum().toString(),
|
|
||||||
productCategories,ObjectUtil.isNull(shopUserDuty.getQuickAmount())?"0":shopUserDuty.getQuickAmount().toPlainString(),
|
|
||||||
productInfoPOS,productInfos
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS,handoverInfo);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user