Merge remote-tracking branch 'origin/hph' into dev

This commit is contained in:
牛叉闪闪 2024-07-26 11:25:10 +08:00
commit 3c7326b547
2 changed files with 25 additions and 7 deletions

View File

@ -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);
} }
} }

View File

@ -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());