交班打印逻辑修改
This commit is contained in:
parent
c3c169d2b5
commit
a2432316ea
|
|
@ -50,8 +50,9 @@ public class CloudPrinterController {
|
|||
public Result handoverPrint( @RequestHeader("token") String token,
|
||||
@RequestHeader("loginName") String loginName,
|
||||
@RequestHeader("clientType") String clientType,
|
||||
@RequestParam("tradeDay") String tradeDay
|
||||
@RequestParam("tradeDay") String tradeDay,
|
||||
Integer id
|
||||
){
|
||||
return cloudPrinterService.handoverprintData(token,tradeDay,loginName);
|
||||
return cloudPrinterService.handoverprintData(token,id,loginName);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,5 +40,7 @@ public interface ShopUserDutyMapper {
|
|||
|
||||
ShopUserDuty selectByShopIdAndDay(@Param("shopId") Integer shopId,@Param("day") String day);
|
||||
|
||||
void updateStatusById(@Param("id") Integer id, @Param("staffId") Integer staffId);
|
||||
|
||||
// List<String> selectByShopIdAndTradeAll(@Param("shopId") Integer shopId,@Param("day") String day,@Param("tokenId") Integer tokenId);
|
||||
}
|
||||
|
|
@ -514,7 +514,7 @@ public class CloudPrinterService {
|
|||
}
|
||||
|
||||
|
||||
public Result handoverprintData(String token,String tradeDay,String loginName){
|
||||
public Result handoverprintData(String token,Integer id,String loginName){
|
||||
|
||||
|
||||
JSONObject info= TokenUtil.parseParamFromToken(token);
|
||||
|
|
@ -558,7 +558,8 @@ public class CloudPrinterService {
|
|||
return;
|
||||
}
|
||||
|
||||
ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByShopIdAndDay(tbShopInfo.getId(),tradeDay);
|
||||
ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByPrimaryKey(id);
|
||||
// ShopUserDuty shopUserDuty=shopUserDutyMapper.selectByShopIdAndDay(tbShopInfo.getId(),tradeDay);
|
||||
MsgException.checkNull(shopUserDuty,"交班信息不存在");
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -278,8 +278,10 @@ public class DutyService {
|
|||
JSONObject tokenJson = TokenUtil.parseParamFromToken(tbToken.getToken());
|
||||
Integer shopId = tokenJson.getInteger("shopId");
|
||||
Integer staffId = tokenJson.getInteger("staffId");
|
||||
cloudPrinterService.handoverprintData(token, day, "");
|
||||
shopUserDutyMapper.updateStatusByTokenId(day, shopId, staffId);
|
||||
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId, "0");
|
||||
cloudPrinterService.handoverprintData(token, shopUserDuty.getId(), "");
|
||||
// shopUserDutyMapper.updateStatusByTokenId(day, shopId, staffId);
|
||||
shopUserDutyMapper.updateStatusById(shopUserDuty.getId(),staffId);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ public class ShopInfoService {
|
|||
Integer shopId = jsonObject.getInteger("shopId");
|
||||
String day = DateUtils.getDay();
|
||||
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByTokenId(tbToken.getId());
|
||||
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId,day);
|
||||
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndStatus(shopId,"0");
|
||||
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId,day);
|
||||
// List<String> list = shopUserDutyMapper.selectByShopIdAndTradeAll(shopId,day,tbToken.getId());
|
||||
if (Objects.nonNull(shopUserDuty)){
|
||||
// PageHelper.startPage(page, pageSize);
|
||||
|
|
|
|||
|
|
@ -224,6 +224,9 @@
|
|||
<update id="updateStatusByTokenId">
|
||||
update tb_shop_user_duty set status = '1' , login_out_time = now(),user_id = #{staffId} where shop_id = #{shopId} and trade_day = #{day} and status = '0'
|
||||
</update>
|
||||
<update id="updateStatusById">
|
||||
update tb_shop_user_duty set status = '1' , login_out_time = now(),user_id = #{staffId} where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectByShopIdAndDay" resultMap="BaseResultMap">
|
||||
select * from tb_shop_user_duty where trade_day = #{day} and shop_id = #{shopId} order by id desc limit 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue