Merge remote-tracking branch 'origin/hph' into dev
This commit is contained in:
commit
3c7326b547
|
|
@ -34,7 +34,7 @@ public class DataController {
|
||||||
@RequestHeader("clientType") String clientType,
|
@RequestHeader("clientType") String clientType,
|
||||||
Integer id,
|
Integer id,
|
||||||
boolean isprintProduct){
|
boolean isprintProduct){
|
||||||
return dataService.handoverprint(id,isprintProduct);
|
return dataService.handoverprint(token,id,isprintProduct);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
@ -133,8 +130,24 @@ public class DataService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Result handoverprint(Integer id,boolean isprintProduct){
|
public Result handoverprint(String token,Integer id,boolean isprintProduct){
|
||||||
if(ObjectUtil.isNotEmpty(id)){
|
if(ObjectUtil.isNotEmpty(id)){
|
||||||
|
|
||||||
|
JSONObject jsonObject= TokenUtil.parseParamFromToken(token);
|
||||||
|
if(Objects.isNull(jsonObject)){
|
||||||
|
return Result.fail(CodeEnum.TOKENTERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
TbPlussShopStaff shopStaff;
|
||||||
|
|
||||||
|
String staffId = jsonObject.getString("staffId");
|
||||||
|
if(ObjectUtil.isNotEmpty(staffId)){
|
||||||
|
shopStaff= tbPlussShopStaffMapper.selectByPrimaryKey(Integer.valueOf(staffId));
|
||||||
|
} else {
|
||||||
|
shopStaff = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByPrimaryKey(id);
|
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByPrimaryKey(id);
|
||||||
if(ObjectUtil.isNotEmpty(shopUserDuty)){
|
if(ObjectUtil.isNotEmpty(shopUserDuty)){
|
||||||
|
|
||||||
|
|
@ -209,7 +222,7 @@ public class DataService {
|
||||||
HandoverInfo handoverInfo = new HandoverInfo(tbShopInfo.getShopName(),
|
HandoverInfo handoverInfo = new HandoverInfo(tbShopInfo.getShopName(),
|
||||||
ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime()) ? DateUtils.getTime(shopUserDuty.getLoginTime()) : null,
|
ObjectUtil.isNotEmpty(shopUserDuty.getLoginTime()) ? DateUtils.getTime(shopUserDuty.getLoginTime()) : null,
|
||||||
DateUtils.getTime(new Date()),
|
DateUtils.getTime(new Date()),
|
||||||
"",
|
ObjectUtil.isNull(shopStaff)?"":shopStaff.getAccount(),
|
||||||
list, memberData, shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount()) ? BigDecimal.ZERO : shopUserDuty.getQuickAmount()).toPlainString(),
|
list, memberData, shopUserDuty.getAmount().add(ObjectUtil.isNull(shopUserDuty.getQuickAmount()) ? BigDecimal.ZERO : shopUserDuty.getQuickAmount()).toPlainString(),
|
||||||
"0",
|
"0",
|
||||||
shopUserDuty.getAmount().subtract(shopUserDuty.getReturnAmount()).toPlainString(),
|
shopUserDuty.getAmount().subtract(shopUserDuty.getReturnAmount()).toPlainString(),
|
||||||
|
|
@ -222,6 +235,11 @@ public class DataService {
|
||||||
);
|
);
|
||||||
|
|
||||||
tbHandover tbHandover=new tbHandover();
|
tbHandover tbHandover=new tbHandover();
|
||||||
|
|
||||||
|
if(ObjectUtil.isNotNull(shopStaff)){
|
||||||
|
tbHandover.setStaffId(shopStaff.getId());
|
||||||
|
tbHandover.setStaffName(shopStaff.getAccount());
|
||||||
|
}
|
||||||
tbHandover.setTradeDay(DateUtils.getDays());
|
tbHandover.setTradeDay(DateUtils.getDays());
|
||||||
tbHandover.setPrintNo(it.getAddress());
|
tbHandover.setPrintNo(it.getAddress());
|
||||||
tbHandover.setDutyId(shopUserDuty.getId());
|
tbHandover.setDutyId(shopUserDuty.getId());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue